From owner-freebsd-bugs@freebsd.org Mon Jul 27 08:41:22 2015 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C259AB2BD for ; Mon, 27 Jul 2015 08:41:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5A27F71 for ; Mon, 27 Jul 2015 08:41:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t6R8fLFA089054 for ; Mon, 27 Jul 2015 08:41:21 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 201916] mac address does not update when removing the primary iface from a lagg Date: Mon, 27 Jul 2015 08:41:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: shahark@mellanox.com X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2015 08:41:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201916 Bug ID: 201916 Summary: mac address does not update when removing the primary iface from a lagg Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: shahark@mellanox.com When removing the primary iface froma lagg - the mac should update to the mac address of the next iface in the lagg list. Currently it happens but not to the one that is now the new primary. To reproduce: # ifconfig lagg0 create laggport ifp0 laggport ifp1 # ifconfig lagg0 -laggport ifp0 and look at the macs before and after The problem is that the code mark the next ifp as primary(@lagg_port_lladdr) and then skip updating it because it is primary(@lagg_port_setlladdr). suggested fix: diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index dcd005a..f9e2312 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -691,22 +691,23 @@ lagg_port_setlladdr(void *arg, int pending) * Traverse the queue and set the lladdr on each ifp. It is safe to do * unlocked as we have the only reference to it. */ + for (llq = head; llq != NULL; llq = head) { ifp = llq->llq_ifp; - CURVNET_SET(ifp->if_vnet); - if (llq->llq_primary == 0) { - /* - * Set the link layer address on the laggport interface. - * if_setlladdr() triggers gratuitous ARPs for INET. - */ - error = if_setlladdr(ifp, llq->llq_lladdr, - ETHER_ADDR_LEN); - if (error) - printf("%s: setlladdr failed on %s\n", __func__, - ifp->if_xname); - } else + + /* + * Set the link layer address on the laggport interface. + * if_setlladdr() triggers gratuitous ARPs for INET. + */ + error = if_setlladdr(ifp, llq->llq_lladdr, + ETHER_ADDR_LEN); + if (error) + printf("%s: setlladdr failed on %s\n", __func__, + ifp->if_xname); + if (llq->llq_primary) { EVENTHANDLER_INVOKE(iflladdr_event, ifp); + } CURVNET_RESTORE(); head = SLIST_NEXT(llq, llq_entries); free(llq, M_DEVBUF); -- You are receiving this mail because: You are the assignee for the bug.