* Calculate max IPv6 MTU through all the interfaces and store it * to in6_maxmtu. */
| 2016 | * to in6_maxmtu. |
| 2017 | */ |
| 2018 | void |
| 2019 | in6_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 |
no outgoing calls
no test coverage detected