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

Function in6_setmaxmtu

freebsd/netinet6/in6.c:2018–2037  ·  view source on GitHub ↗

* Calculate max IPv6 MTU through all the interfaces and store it * to in6_maxmtu. */

Source from the content-addressed store, hash-verified

2016 * to in6_maxmtu.
2017 */
2018void
2019in6_setmaxmtu(void)
2020{
2021 struct epoch_tracker et;
2022 unsigned long maxmtu = 0;
2023 struct ifnet *ifp;
2024
2025 NET_EPOCH_ENTER(et);
2026 CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
2027 /* this function can be called during ifnet initialization */
2028 if (!ifp->if_afdata[AF_INET6])
2029 continue;
2030 if ((ifp->if_flags & IFF_LOOPBACK) == 0 &&
2031 IN6_LINKMTU(ifp) > maxmtu)
2032 maxmtu = IN6_LINKMTU(ifp);
2033 }
2034 NET_EPOCH_EXIT(et);
2035 if (maxmtu) /* update only when maxmtu is positive */
2036 V_in6_maxmtu = maxmtu;
2037}
2038
2039/*
2040 * Provide the length of interface identifiers to be used for the link attached

Callers 2

nd6_setmtu0Function · 0.85
nd6_ra_inputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected