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

Function in6_selecthlim

freebsd/netinet6/in6_src.c:907–930  ·  view source on GitHub ↗

* Default hop limit selection. The precedence is as follows: * 1. Hoplimit value specified via ioctl. * 2. (If the outgoing interface is detected) the current * hop limit of the interface specified by router advertisement. * 3. The system default hoplimit. */

Source from the content-addressed store, hash-verified

905 * 3. The system default hoplimit.
906 */
907int
908in6_selecthlim(struct inpcb *inp, struct ifnet *ifp)
909{
910
911 if (inp && inp->in6p_hops >= 0)
912 return (inp->in6p_hops);
913 else if (ifp)
914 return (ND_IFINFO(ifp)->chlim);
915 else if (inp && !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
916 struct nhop_object *nh;
917 struct in6_addr dst;
918 uint32_t fibnum, scopeid;
919 int hlim;
920
921 fibnum = inp->inp_inc.inc_fibnum;
922 in6_splitscope(&inp->in6p_faddr, &dst, &scopeid);
923 nh = fib6_lookup(fibnum, &dst, scopeid, 0, 0);
924 if (nh != NULL) {
925 hlim = ND_IFINFO(nh->nh_ifp)->chlim;
926 return (hlim);
927 }
928 }
929 return (V_ip6_defhlim);
930}
931
932/*
933 * XXX: this is borrowed from in6_pcbbind(). If possible, we should

Callers 9

tcp_output.cFile · 0.85
syncache_addFunction · 0.85
tcp_twrespondFunction · 0.85
tcp_respondFunction · 0.85
rack.cFile · 0.85
bbr.cFile · 0.85
in6_selectsrc_socketFunction · 0.85
in6_selectsrc_addrFunction · 0.85
udp6_outputFunction · 0.85

Calls 2

in6_splitscopeFunction · 0.85
fib6_lookupFunction · 0.85

Tested by

no test coverage detected