NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/45675: 'ifconfig intf netmask 0xnnnnnnnn' silently fails



>Number:         45675
>Category:       kern
>Synopsis:       'ifconfig intf netmask 0xnnnnnnnn' silently fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 02 00:30:01 +0000 2011
>Originator:     River Tarnell
>Release:        NetBSD 5.1.0_PATCH
>Organization:
RT.UK.EU.ORG
>Environment:
System: NetBSD tamara.rt.uk.eu.org 5.1.0_PATCH NetBSD 5.1.0_PATCH (TAMARA) #2: 
Thu Aug 4 18:30:08 UTC 2011 
root%tamara.tcx.org.uk@localhost:/usr/src/sys/arch/amd64/compile/TAMARA amd64
Architecture: x86_64
Machine: amd64
>Description:
Setting netmask on an interface with ifconfig fails if no address is specified:

vpn# ifconfig xennet0 inet
xennet0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities=2800<TCP4CSUM_Tx,UDP4CSUM_Tx>
        enabled=0
        address: 00:16:3e:00:00:84
        inet 46.17.56.132 netmask 0xfffffff8 broadcast 46.17.56.135
vpn# ifconfig xennet0 inet netmask 0xfffffff0
vpn# ifconfig xennet0 inet                   
xennet0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities=2800<TCP4CSUM_Tx,UDP4CSUM_Tx>
        enabled=0
        address: 00:16:3e:00:00:84
        inet 46.17.56.132 netmask 0xfffffff8 broadcast 46.17.56.135

If an address is specified, the change works:

vpn# ifconfig xennet0 inet 46.17.56.132 netmask 0xfffffff0
vpn# ifconfig xennet0 inet                                
xennet0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities=2800<TCP4CSUM_Tx,UDP4CSUM_Tx>
        enabled=0
        address: 00:16:3e:00:00:84
        inet 46.17.56.132 netmask 0xfffffff0 broadcast 46.17.56.143

If this is not intended to work, then ifconfig should emit an error message 
rather than failing silently.  However, a better fix would be for the command 
to work.
>How-To-Repeat:
See description.
>Fix:
N/A



Home | Main Index | Thread Index | Old Index