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

Function nd6_setmtu0

freebsd/netinet6/nd6.c:344–367  ·  view source on GitHub ↗

XXX todo: do not maintain copy of ifp->if_mtu in ndi->maxmtu */

Source from the content-addressed store, hash-verified

342
343/* XXX todo: do not maintain copy of ifp->if_mtu in ndi->maxmtu */
344void
345nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi)
346{
347 u_int32_t omaxmtu;
348
349 omaxmtu = ndi->maxmtu;
350 ndi->maxmtu = ifp->if_mtu;
351
352 /*
353 * Decreasing the interface MTU under IPV6 minimum MTU may cause
354 * undesirable situation. We thus notify the operator of the change
355 * explicitly. The check for omaxmtu is necessary to restrict the
356 * log to the case of changing the MTU, not initializing it.
357 */
358 if (omaxmtu >= IPV6_MMTU && ndi->maxmtu < IPV6_MMTU) {
359 log(LOG_NOTICE, "nd6_setmtu0: "
360 "new link MTU on %s (%lu) is too small for IPv6\n",
361 if_name(ifp), (unsigned long)ndi->maxmtu);
362 }
363
364 if (ndi->maxmtu > V_in6_maxmtu)
365 in6_setmaxmtu(); /* check all interfaces just in case */
366
367}
368
369void
370nd6_option_init(void *opt, int icmp6len, union nd_opts *ndopts)

Callers 2

nd6_ifattachFunction · 0.85
nd6_setmtuFunction · 0.85

Calls 2

in6_setmaxmtuFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected