Bug 163701

Summary: ifconfig: group parameter makes impossible to restart interface
Product: Base System Reporter: d.y.kazarov
Component: kernAssignee: Alan Somers <asomers>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 8.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description d.y.kazarov 2011-12-29 21:20:08 UTC
If group parameter is specified in /etc/rc.conf it makes /etc/rc.d/netif restart to fail:

# fgrep re0 /etc/rc.conf
ifconfig_re0='192.168.1.20/24 group ifgrp'

# ifconfig -v re0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3898<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:1f:d0:5e:8f:57
        inet 192.168.1.20 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        groups: ifgrp 

# /etc/rc.d/netif restart re0
Stopping Network: re0.
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3898<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:1f:d0:5e:8f:57
        media: Ethernet autoselect (none)
        status: no carrier
ifconfig:  SIOCAIFGROUP: File exists
Starting Network: re0.
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3898<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:1f:d0:5e:8f:57
        media: Ethernet autoselect (none)
        status: no carrier


The source of problem is that groups parameter persist when interface goes down:

# /etc/rc.d/netif stop re0
Stopping Network: re0.
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3898<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:1f:d0:5e:8f:57
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
# ifconfig -v re0
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3898<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:1f:d0:5e:8f:57
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        groups: ifgrp 


IMHO it's better to just ignore error when group param specifies groupname to which interface is already  assigned.
Comment 1 Alan Somers freebsd_committer freebsd_triage 2014-03-08 00:31:28 UTC
Responsible Changed
From-To: freebsd-bugs->asomers

I'll take it
Comment 2 Alan Somers freebsd_committer freebsd_triage 2014-03-25 15:09:44 UTC
State Changed
From-To: open->patched

Independently fixed by des in change 256768.  The fix is in stable/10 
but not yet in stable/9
Comment 3 Alan Somers freebsd_committer freebsd_triage 2014-03-25 16:50:41 UTC
State Changed
From-To: patched->closed

MFCed to stable/9 by r263739