MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bridge_linkcheck

Function bridge_linkcheck

freebsd/net/if_bridge.c:3655–3679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3653}
3654
3655static void
3656bridge_linkcheck(struct bridge_softc *sc)
3657{
3658 struct bridge_iflist *bif;
3659 int new_link, hasls;
3660
3661 BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(sc);
3662
3663 new_link = LINK_STATE_DOWN;
3664 hasls = 0;
3665 /* Our link is considered up if at least one of our ports is active */
3666 CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
3667 if (bif->bif_ifp->if_capabilities & IFCAP_LINKSTATE)
3668 hasls++;
3669 if (bif->bif_ifp->if_link_state == LINK_STATE_UP) {
3670 new_link = LINK_STATE_UP;
3671 break;
3672 }
3673 }
3674 if (!CK_LIST_EMPTY(&sc->sc_iflist) && !hasls) {
3675 /* If no interfaces support link-state then we default to up */
3676 new_link = LINK_STATE_UP;
3677 }
3678 if_link_state_change(sc->sc_ifp, new_link);
3679}

Callers 3

bridge_delete_memberFunction · 0.85
bridge_ioctl_addFunction · 0.85
bridge_linkstateFunction · 0.85

Calls 1

if_link_state_changeFunction · 0.85

Tested by

no test coverage detected