summaryrefslogtreecommitdiffstats
path: root/sys/net/ieee8023ad_lacp.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2007-05-07 00:18:56 +0000
committerthompsa <thompsa@FreeBSD.org>2007-05-07 00:18:56 +0000
commitcaab23fd294a310227a4c2f4912f639cdebc28e2 (patch)
treece0d3495b9167705eac6cf537e571262085ec09e /sys/net/ieee8023ad_lacp.c
parent38031925b7d011576f9184b9a3788e787ae55aa1 (diff)
downloadFreeBSD-src-caab23fd294a310227a4c2f4912f639cdebc28e2.zip
FreeBSD-src-caab23fd294a310227a4c2f4912f639cdebc28e2.tar.gz
Change from using if_delmulti() to if_delmulti_ifma() as it simplifies the code
and is safe to use if the ifp has disappeared. Suggested by: bms
Diffstat (limited to 'sys/net/ieee8023ad_lacp.c')
-rw-r--r--sys/net/ieee8023ad_lacp.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index 68d8d40..2753c98 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -453,6 +453,7 @@ lacp_port_create(struct lagg_port *lgp)
lp->lp_ifp = ifp;
lp->lp_lagg = lgp;
lp->lp_lsc = lsc;
+ lp->lp_ifma = rifma;
LIST_INSERT_HEAD(&lsc->lsc_ports, lp, lp_next);
@@ -471,9 +472,7 @@ void
lacp_port_destroy(struct lagg_port *lgp)
{
struct lacp_port *lp = LACP_PORT(lgp);
- struct ifnet *ifp = lgp->lp_ifp;
- struct sockaddr_dl sdl;
- int i, error;
+ int i;
LAGG_LOCK_ASSERT(lgp->lp_lagg);
@@ -486,18 +485,7 @@ lacp_port_destroy(struct lagg_port *lgp)
lacp_unselect(lp);
lgp->lp_flags &= ~LAGG_PORT_DISABLED;
- bzero((char *)&sdl, sizeof(sdl));
- sdl.sdl_len = sizeof(sdl);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_index = ifp->if_index;
- sdl.sdl_type = IFT_ETHER;
- sdl.sdl_alen = ETHER_ADDR_LEN;
-
- bcopy(&ethermulticastaddr_slowprotocols,
- LLADDR(&sdl), ETHER_ADDR_LEN);
- error = if_delmulti(ifp, (struct sockaddr *)&sdl);
- if (error)
- printf("%s: DELMULTI failed on %s\n", __func__, lgp->lp_ifname);
+ if_delmulti_ifma(lp->lp_ifma);
LIST_REMOVE(lp, lp_next);
free(lp, M_DEVBUF);
OpenPOWER on IntegriCloud