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

Function ip6_getpmtu_ctl

freebsd/netinet6/ip6_output.c:1460–1480  ·  view source on GitHub ↗

* Calculates IPv6 path mtu for destination @dst. * Resulting MTU is stored in @mtup. * * Returns 0 on success. */

Source from the content-addressed store, hash-verified

1458 * Returns 0 on success.
1459 */
1460static int
1461ip6_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,

Callers 1

ip6_ctloutputFunction · 0.85

Calls 3

in6_splitscopeFunction · 0.85
fib6_lookupFunction · 0.85
ip6_calcmtuFunction · 0.85

Tested by

no test coverage detected