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

Function me_srcaddr

freebsd/net/if_me.c:383–401  ·  view source on GitHub ↗

* ifaddr_event handler. * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent * source address spoofing. */

Source from the content-addressed store, hash-verified

381 * source address spoofing.
382 */
383static void
384me_srcaddr(void *arg __unused, const struct sockaddr *sa,
385 int event __unused)
386{
387 const struct sockaddr_in *sin;
388 struct me_softc *sc;
389
390 /* Check that VNET is ready */
391 if (V_me_hashtbl == NULL)
392 return;
393
394 NET_EPOCH_ASSERT();
395 sin = (const struct sockaddr_in *)sa;
396 CK_LIST_FOREACH(sc, &ME_SRCHASH(sin->sin_addr.s_addr), srchash) {
397 if (sc->me_src.s_addr != sin->sin_addr.s_addr)
398 continue;
399 me_set_running(sc);
400 }
401}
402
403static int
404me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst)

Callers

nothing calls this directly

Calls 1

me_set_runningFunction · 0.85

Tested by

no test coverage detected