Date: Mon, 9 Jul 2001 08:40:03 -0700 (PDT) From: Peter Pentchev <roam@orbitel.bg> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/28833: ifconfig if0 netmask xxx.xxx.xxx.0 doesn't change the netmask Message-ID: <200107091540.f69Fe3S83161@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/28833; it has been noted by GNATS.
From: Peter Pentchev <roam@orbitel.bg>
To: Mark Blackman <mark.blackman@netscalibur.co.uk>
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<BROADCAST,SIMPLEX,MULTICAST> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107091540.f69Fe3S83161>
