Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Apr 2011 18:03:07 +0100
From:      Mike Bristow <mike@urgle.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Sergey Vinogradov <boogie@lazybytes.org>, hackers@freebsd.org
Subject:   Re: ifconfig output: ipv4 netmask format
Message-ID:  <20110409170307.GA50972@cheddar.urgle.com>
In-Reply-To: <BD12DE29-B333-4560-8408-E64CFAAD810A@bsdimp.com>
References:  <4D9EFAC6.4020906@lazybytes.org> <7EA5889E-77EF-4BAE-9655-C33692A75602@bsdimp.com> <4D9F2C88.4010205@lazybytes.org> <20110408155520.GA40792@cheddar.urgle.com> <BD12DE29-B333-4560-8408-E64CFAAD810A@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110409170307.GA50972>