From owner-freebsd-bugs Mon Jul 9 8:40: 6 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CE6C637B401 for ; Mon, 9 Jul 2001 08:40:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f69Fe3S83161; Mon, 9 Jul 2001 08:40:03 -0700 (PDT) (envelope-from gnats) Date: Mon, 9 Jul 2001 08:40:03 -0700 (PDT) Message-Id: <200107091540.f69Fe3S83161@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: bin/28833: ifconfig if0 netmask xxx.xxx.xxx.0 doesn't change the netmask Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/28833; it has been noted by GNATS. From: Peter Pentchev To: Mark Blackman Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/28833: ifconfig if0 netmask xxx.xxx.xxx.0 doesn't change the netmask Date: Mon, 9 Jul 2001 18:39:50 +0300 On Mon, Jul 09, 2001 at 08:16:15AM -0700, Mark Blackman wrote: > > >Number: 28833 > >Category: bin > >Synopsis: ifconfig if0 netmask xxx.xxx.xxx.0 doesn't change the netmask > >Environment: > System: FreeBSD amoeba.ch.dircon.net 4.3-STABLE FreeBSD 4.3-STABLE #1: Thu May 24 13:03:35 BST 2001 root@admi > n4.dircon.net:/usr/obj/usr/src/sys/AMOEBA i386 > >Description: > "ifconfig ep0 netmask 255.255.240.0" has no effect on the netmask for ep0 > > This did work in FreeBSD-4.2 RELEASE. I suspect this is connnected with ifconfig changes, but I couldn't track it down. It looked like it shouldn't work in 4.2 either, but it does. It works for me, if I also specify the IP address to change the netmask for. Consider a case where there are multiple IP addresses on a single interface; ifconfig should probably spit out an error instead of doing nothing, but it should most definitely not change the netmask on *all* addresses, and I guess it was considered unsafe to make it just change the netmask on the first address. Demonstration: # clean start [root@ringworld:v0 ~]# ifconfig rl0 rl0: flags=8802 mtu 1500 ether 00:e0:18:18:f2:0e media: Ethernet autoselect (none) status: active # add an IP address (with an erroneous netmask) [root@ringworld:v0 ~]# ifconfig rl0 195.24.48.13 netmask 255.255.0.0 [root@ringworld:v0 ~]# ifconfig rl0 rl0: flags=8843 mtu 1500 inet 195.24.48.13 netmask 0xffff0000 broadcast 195.24.255.255 ether 00:e0:18:18:f2:0e media: Ethernet autoselect (none) status: active # attempt to change the netmask without specifying the address [root@ringworld:v0 ~]# ifconfig rl0 netmask 255.255.255.0 [root@ringworld:v0 ~]# ifconfig rl0 rl0: flags=8843 mtu 1500 inet 195.24.48.13 netmask 0xffff0000 broadcast 195.24.255.255 ether 00:e0:18:18:f2:0e media: Ethernet autoselect (none) status: active # now do it "the right way" [root@ringworld:v0 ~]# ifconfig rl0 195.24.48.13 netmask 255.255.255.0 [root@ringworld:v0 ~]# ifconfig rl0 rl0: flags=8843 mtu 1500 inet 195.24.48.13 netmask 0xffffff00 broadcast 195.24.48.255 ether 00:e0:18:18:f2:0e media: Ethernet autoselect (none) status: active Does that work for you? G'luck, Peter -- This would easier understand fewer had omitted. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message