XXX todo: do not maintain copy of ifp->if_mtu in ndi->maxmtu */
| 342 | |
| 343 | /* XXX todo: do not maintain copy of ifp->if_mtu in ndi->maxmtu */ |
| 344 | void |
| 345 | nd6_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 | |
| 369 | void |
| 370 | nd6_option_init(void *opt, int icmp6len, union nd_opts *ndopts) |
no test coverage detected