* Calculates IPv6 path mtu for destination @dst. * Resulting MTU is stored in @mtup. * * Returns 0 on success. */
| 1458 | * Returns 0 on success. |
| 1459 | */ |
| 1460 | static int |
| 1461 | ip6_getpmtu_ctl(u_int fibnum, const struct in6_addr *dst, u_long *mtup) |
| 1462 | { |
| 1463 | struct epoch_tracker et; |
| 1464 | struct nhop_object *nh; |
| 1465 | struct in6_addr kdst; |
| 1466 | uint32_t scopeid; |
| 1467 | int error; |
| 1468 | |
| 1469 | in6_splitscope(dst, &kdst, &scopeid); |
| 1470 | |
| 1471 | NET_EPOCH_ENTER(et); |
| 1472 | nh = fib6_lookup(fibnum, &kdst, scopeid, NHR_NONE, 0); |
| 1473 | if (nh != NULL) |
| 1474 | error = ip6_calcmtu(nh->nh_ifp, dst, nh->nh_mtu, mtup, NULL, 0); |
| 1475 | else |
| 1476 | error = EHOSTUNREACH; |
| 1477 | NET_EPOCH_EXIT(et); |
| 1478 | |
| 1479 | return (error); |
| 1480 | } |
| 1481 | |
| 1482 | /* |
| 1483 | * Calculates IPv6 path MTU for @dst based on transmit @ifp, |
no test coverage detected