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

Function stf_checkaddr6

freebsd/net/if_stf.c:586–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584}
585
586static int
587stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp)
588{
589 /*
590 * check 6to4 addresses
591 */
592 if (IN6_IS_ADDR_6TO4(in6)) {
593 struct in_addr in4;
594 bcopy(GET_V4(in6), &in4, sizeof(in4));
595 return stf_checkaddr4(sc, &in4, inifp);
596 }
597
598 /*
599 * reject anything that look suspicious. the test is implemented
600 * in ip6_input too, but we check here as well to
601 * (1) reject bad packets earlier, and
602 * (2) to be safe against future ip6_input change.
603 */
604 if (IN6_IS_ADDR_V4COMPAT(in6) || IN6_IS_ADDR_V4MAPPED(in6))
605 return -1;
606
607 return 0;
608}
609
610static int
611in_stf_input(struct mbuf *m, int off, int proto, void *arg)

Callers 1

in_stf_inputFunction · 0.85

Calls 1

stf_checkaddr4Function · 0.85

Tested by

no test coverage detected