Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jun 2012 20:57:00 GMT
From:      Mark Johnston <markjdb@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/169557: [patch][lagg] handle interface renames
Message-ID:  <201206292057.q5TKv01L082213@red.freebsd.org>
Resent-Message-ID: <201206292100.q5TL0NWt049163@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         169557
>Category:       kern
>Synopsis:       [patch][lagg] handle interface renames
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 29 21:00:22 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Mark Johnston
>Release:        CURRENT
>Organization:
Sandvine Inc.
>Environment:
$ uname -a
FreeBSD oddish 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r237569+921e55b: Mon Jun 25 17:56:13 EDT 2012     mark@oddish:/home/mark/src/obj/usr/home/mark/src/freebsd/sys/GENERIC  amd64
>Description:
Renaming an interface that's part of a lagg will cause if_lagg(4) to remove it from the group. This is because if_lagg(4) sees the interface's departure event and assumes it's leaving forever. With a rename, this isn't the case.
>How-To-Repeat:
# ifconfig lagg0 create
# ifconfig lagg0 laggproto failover laggport re0
# ifconfig re0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether f0:de:f1:9c:8e:a9
        inet 192.168.200.21 netmask 0xfffffe00 broadcast 192.168.201.255 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether f0:de:f1:9c:8e:a9
        inet 192.168.200.21 netmask 0xfffffe00 broadcast 192.168.201.255 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
        laggproto failover lagghash l2,l3,l4
        laggport: re0 flags=5<MASTER,ACTIVE>
# ifconfig re0 name foo0
# ifconfig lagg0
lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:00:00:00:00:00
        inet 192.168.200.21 netmask 0xfffffe00 broadcast 192.168.201.255 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: no carrier
        laggproto failover lagghash l2,l3,l4
>Fix:
Apply the patch. There is an identical check in the corresponding function for if_vlan(4).

Patch attached with submission follows:

diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 9041e18..af2fdbc 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -797,6 +797,8 @@ lagg_port_ifdetach(void *arg __unused, struct ifnet *ifp)
 
 	if ((lp = ifp->if_lagg) == NULL)
 		return;
+	if (ifp->if_flags & IFF_RUNNING)
+		return;
 
 	sc = lp->lp_softc;
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206292057.q5TKv01L082213>