From owner-freebsd-net Fri Oct 5 11:50:20 2001 Delivered-To: freebsd-net@freebsd.org Received: from vetnet5.vetorialnet.com.br (vetnet5.vetorialnet.com.br [200.248.179.9]) by hub.freebsd.org (Postfix) with ESMTP id A288A37B406 for ; Fri, 5 Oct 2001 11:50:16 -0700 (PDT) Received: from localhost (thiago_vet@localhost) by vetnet5.vetorialnet.com.br (8.11.4/8.11.3) with ESMTP id f95IviG57498; Fri, 5 Oct 2001 15:57:44 -0300 (BRT) (envelope-from thiago_vet@vetnet5.vetorialnet.com.br) Date: Fri, 5 Oct 2001 15:57:44 -0300 (BRT) From: Thiago Damas To: Matthew Cc: Subject: Re: ifconfig quirks In-Reply-To: <005601c14dc8$1c19dee0$8f64a8c0@jimsfw.com> Message-ID: <20011005155404.F57457-100000@vetnet5.vetorialnet.com.br> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org When you use numbers with a zero (0) as the first caracter, the C language think that is in octal. 007 in octal = 7 in decimal 034 in octal = 24 in decimal ... ... Then, use the ifconfig without the zero (0) in the first caracter On Fri, 5 Oct 2001, Matthew wrote: > I just wanted to point out something strange I ran into on my test > network with release 4.4. > > if I use "ifconfig xl1 inet 10.0.0.007 netmask 255.255.255.0" > I get upon looking at the adapter > inet 10.0.0.7 netmask 0xffffff00 broadcast 10.0.0.255 > > however when I use "ifconfig xl1 inet 10.0.0.034 netmask 255.255.255.0" > I get > inet 10.0.0.28 netmask 0xffffff00 broadcast 10.0.0.255 > > and yet again if I use " ifconfig xl1 inet 10.0.0.52 netmask 255.255.255.0 " > I get > inet 10.0.0.42 netmask 0xffffff00 broadcast 10.0.0.255 > > and a third time I use "ifconfig xl1 inet 10.0.0.61 netmask 255.255.255.0" > and I get > inet 10.0.0.49 netmask 0xffffff00 broadcast 10.0.0.255 > > I have done this on three different freebsd 4.4 release machines with the > exact same results on each. if I do not use the leading zero's in the last > octet it works correctly. However I have at least three nics in each machine > with multiple ip's on > most interfaces to simulate my existing network so it would be nice to be > able to use them as place holders to make the files look a bit cleaner. > Cheers, > Matthew > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message