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

Function ipsec_set_running

freebsd/net/if_ipsec.c:779–803  ·  view source on GitHub ↗

* Check that ingress address belongs to local host. */

Source from the content-addressed store, hash-verified

777 * Check that ingress address belongs to local host.
778 */
779static void
780ipsec_set_running(struct ipsec_softc *sc)
781{
782 struct secasindex *saidx;
783 int localip;
784
785 saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sc->family);
786 localip = 0;
787 switch (sc->family) {
788#ifdef INET
789 case AF_INET:
790 localip = in_localip(saidx->src.sin.sin_addr);
791 break;
792#endif
793#ifdef INET6
794 case AF_INET6:
795 localip = in6_localip(&saidx->src.sin6.sin6_addr);
796 break;
797#endif
798 }
799 if (localip != 0)
800 sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
801 else
802 sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
803}
804
805/*
806 * ifaddr_event handler.

Callers 2

ipsec_srcaddrFunction · 0.85
ipsec_set_tunnelFunction · 0.85

Calls 3

ipsec_getsaidxFunction · 0.85
in_localipFunction · 0.85
in6_localipFunction · 0.85

Tested by

no test coverage detected