From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 9 17:16:26 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E736B1065674 for ; Sat, 9 Apr 2011 17:16:26 +0000 (UTC) (envelope-from mike@urgle.com) Received: from lon1-post-2.mail.demon.net (lon1-post-2.mail.demon.net [195.173.77.149]) by mx1.freebsd.org (Postfix) with ESMTP id AF97A8FC15 for ; Sat, 9 Apr 2011 17:16:26 +0000 (UTC) Received: from cheddar.urgle.com ([80.177.40.53]) by lon1-post-2.mail.demon.net with esmtp (Exim 4.69) id 1Q8bYx-0003Dz-cK; Sat, 09 Apr 2011 17:03:07 +0000 Received: from mike by cheddar.urgle.com with local (Exim 4.75 (FreeBSD)) (envelope-from ) id 1Q8bYx-000DIu-Bv; Sat, 09 Apr 2011 17:03:07 +0000 Date: Sat, 9 Apr 2011 18:03:07 +0100 From: Mike Bristow To: Warner Losh Message-ID: <20110409170307.GA50972@cheddar.urgle.com> References: <4D9EFAC6.4020906@lazybytes.org> <7EA5889E-77EF-4BAE-9655-C33692A75602@bsdimp.com> <4D9F2C88.4010205@lazybytes.org> <20110408155520.GA40792@cheddar.urgle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Sergey Vinogradov , hackers@freebsd.org Subject: Re: ifconfig output: ipv4 netmask format X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2011 17:16:27 -0000 On Fri, Apr 08, 2011 at 11:43:16AM -0600, Warner Losh wrote: > > Non-contigous netmasks are legal in IPv4. What do you do if someone adds > > the CIDR flag but the netmask cannot be represented in CIDR notation? > > They have become illegal in the fullness of time. I'll rephrase my point, then: not all netmasks, legal or otherwise, that are accepted by ifconfig, can be represented in CIDR notation (see below). I guess the fact that ifconfig accepts them is a bug - but that merely changes my comment to "Non-contigous netmasks are accepted for IPv4 addresses by some (buggy) utilities. What do you do if someone adds the CIDR flag, but the netmask cannot be represented in CIDR notation?". Cheers, Mike [root@cheddar ~]# ifconfig bridge99 create [root@cheddar ~]# ifconfig bridge99 127.255.0.1 netmask 255.255.255.1 [root@cheddar ~]# ifconfig bridge99 bridge99: flags=8843 metric 0 mtu 1500 ether d6:c6:07:a9:7e:b9 inet 127.255.0.1 netmask 0xffffff01 broadcast 127.255.0.255 [root@cheddar ~]# uname -a FreeBSD cheddar.urgle.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 24 23:04:32 GMT 2011 root@cheddar.urgle.com:/usr/obj/usr/src/sys/GENERIC amd64 [root@cheddar ~]# -- Mike Bristow mike@urgle.com