From owner-freebsd-bugs@freebsd.org Tue Jan 5 17:32:10 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F85BA62A27 for ; Tue, 5 Jan 2016 17:32:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4727512C8 for ; Tue, 5 Jan 2016 17:32:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u05HWAI3073596 for ; Tue, 5 Jan 2016 17:32:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 205926] jail(8): fails to parse ifconfig parameters in ip4.addr and ip6.addr after /netmask Date: Tue, 05 Jan 2016 17:32:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: Mark.Martinec@ijs.si X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 17:32:10 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205926 Bug ID: 205926 Summary: jail(8): fails to parse ifconfig parameters in ip4.addr and ip6.addr after /netmask Product: Base System Version: 10.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: Mark.Martinec@ijs.si The jail(8) man page states that additional ifconfig parameters may be supplied after ip-address/netmask in ip4.addr and ip6.addr (which is needed for example to specify a CARPed IP address): The manpage states: ip4.addr In addition to the IP addresses that are passed to the kernel, an interface, netmask and additional paramters (as supported by ifconfig(8)) may also be specified, in the form =E2=80=9Cinterface|ip-address/netmask param ...=E2=80=9D. As it turns out this does not work, unless /netmask is omitted. Seems like the check_intparams() in /usr/src/usr.sbin/jail/config.c assumes that everything after a slash is a netmask or a mask-length (or IPv6 prefix length), so any parameter following a /netmask is treated as a netmask syntax error. Example: # jail -c ip4.addr=3D'igb0|10.0.0.246/24 vhid 23 advskew 100' \ ip6.addr=3D'igb0|2001:db8::246/64 vhid 23 advskew 100' [...] jail: ip4.addr: bad netmask "/24 vhid 23 advskew 100" jail: ip6.addr: bad prefixlen "/64 vhid 23 advskew 100" Omitting the /24 (and /64) works as intended, but the implied mask length is /32 (and /128). An attempted workaround like: ip4.addr=3D'igb0|10.0.0.246 netmask 255.255.255.0 vhid 23 advskew 100' produces a double netmask option to ifconfig, which may be ambiguous (or a potential syntax error) - as reported by jail -v : run command: /sbin/ifconfig igb0 inet 10.0.0.246 \ netmask 255.255.255.255 netmask 255.255.255.0 vhid 23 advskew 100 alias ( Btw, why does the jail(8) bother to convert a mask length into a netmask, where the ifconfig is perfectly happy with a CIDR notation? ) --=20 You are receiving this mail because: You are the assignee for the bug.=