Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_lagg.c
Show First 20 Lines • Show All 673 Lines • ▼ Show 20 Lines | lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp) | ||||
LAGG_XLOCK_ASSERT(sc); | LAGG_XLOCK_ASSERT(sc); | ||||
if (sc->sc_ifp == ifp) { | if (sc->sc_ifp == ifp) { | ||||
if_printf(sc->sc_ifp, | if_printf(sc->sc_ifp, | ||||
"cannot add a lagg to itself as a port\n"); | "cannot add a lagg to itself as a port\n"); | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
if (sc->sc_destroying == 1) | |||||
return (ENXIO); | |||||
/* Limit the maximal number of lagg ports */ | /* Limit the maximal number of lagg ports */ | ||||
if (sc->sc_count >= LAGG_MAX_PORTS) | if (sc->sc_count >= LAGG_MAX_PORTS) | ||||
return (ENOSPC); | return (ENOSPC); | ||||
/* Check if port has already been associated to a lagg */ | /* Check if port has already been associated to a lagg */ | ||||
if (ifp->if_lagg != NULL) { | if (ifp->if_lagg != NULL) { | ||||
/* Port is already in the current lagg? */ | /* Port is already in the current lagg? */ | ||||
lp = (struct lagg_port *)ifp->if_lagg; | lp = (struct lagg_port *)ifp->if_lagg; | ||||
▲ Show 20 Lines • Show All 1,734 Lines • Show Last 20 Lines |