summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2007-05-07 09:53:02 +0000
committerthompsa <thompsa@FreeBSD.org>2007-05-07 09:53:02 +0000
commite8f1e9a28ef0985110cdfcb77ba7dbb92e35c6d2 (patch)
tree45bf39b30f889a367523e4feb1289dcf1875d9ad /sys/net/if_lagg.c
parentedde22f288dfa5715cfc69ba7ae3c881c0b32e6c (diff)
downloadFreeBSD-src-e8f1e9a28ef0985110cdfcb77ba7dbb92e35c6d2.zip
FreeBSD-src-e8f1e9a28ef0985110cdfcb77ba7dbb92e35c6d2.tar.gz
- Correctly check if lp_ioctl is null
- Remove lagg_ether_purgemulti as its no longer needed - Mark the interface as up if any ports are active rather than just the primary
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index a338248..e22b880 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -98,7 +98,6 @@ static void lagg_stop(struct lagg_softc *);
static int lagg_ioctl(struct ifnet *, u_long, caddr_t);
static int lagg_ether_setmulti(struct lagg_softc *);
static int lagg_ether_cmdmulti(struct lagg_port *, int);
-static void lagg_ether_purgemulti(struct lagg_softc *);
static int lagg_setflag(struct lagg_port *, int, int,
int (*func)(struct ifnet *, int));
static int lagg_setflags(struct lagg_port *, int status);
@@ -624,7 +623,7 @@ lagg_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error);
fallback:
- if (lp != NULL)
+ if (lp->lp_ioctl != NULL)
return ((*lp->lp_ioctl)(ifp, cmd, data));
return (EINVAL);
@@ -917,12 +916,12 @@ lagg_ether_setmulti(struct lagg_softc *sc)
LAGG_LOCK_ASSERT(sc);
- /* First, remove any existing filter entries. */
- lagg_ether_purgemulti(sc);
-
SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
+ /* First, remove any existing filter entries. */
+ lagg_ether_cmdmulti(lp, 0);
+ /* copy all addresses from the lagg interface to the port */
lagg_ether_cmdmulti(lp, 1);
- }
+ }
return (0);
}
@@ -972,17 +971,6 @@ lagg_ether_cmdmulti(struct lagg_port *lp, int set)
return (0);
}
-static void
-lagg_ether_purgemulti(struct lagg_softc *sc)
-{
- struct lagg_port *lp;
-
- LAGG_LOCK_ASSERT(sc);
-
- SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
- lagg_ether_cmdmulti(lp, 0);
-}
-
/* Handle a ref counted flag that should be set on the lagg port as well */
static int
lagg_setflag(struct lagg_port *lp, int flag, int status,
@@ -1118,9 +1106,10 @@ lagg_media_status(struct ifnet *ifp, struct ifmediareq *imr)
imr->ifm_active = IFM_ETHER | IFM_AUTO;
LAGG_LOCK(sc);
- lp = sc->sc_primary;
- if (lp != NULL && lp->lp_ifp->if_flags & IFF_UP)
- imr->ifm_status |= IFM_ACTIVE;
+ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
+ if (LAGG_PORTACTIVE(lp))
+ imr->ifm_status |= IFM_ACTIVE;
+ }
LAGG_UNLOCK(sc);
}
OpenPOWER on IntegriCloud