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

Function fib6_check_urpf

freebsd/netinet6/in6_fib.c:266–282  ·  view source on GitHub ↗

* Performs reverse path forwarding lookup. * If @src_if is non-zero, verifies that at least 1 path goes via * this interface. * If @src_if is zero, verifies that route exist. * if @flags contains NHR_NOTDEFAULT, do not consider default route. * * Returns 1 if route matching conditions is found, 0 otherwise. */

Source from the content-addressed store, hash-verified

264 * Returns 1 if route matching conditions is found, 0 otherwise.
265 */
266int
267fib6_check_urpf(uint32_t fibnum, const struct in6_addr *dst6,
268 uint32_t scopeid, uint32_t flags, const struct ifnet *src_if)
269{
270 struct nhop_object *nh;
271#ifdef FIB_ALGO
272 struct fib_dp *dp = &V_inet6_dp[fibnum];
273 struct flm_lookup_key key = {.addr6 = dst6 };
274
275 nh = dp->f(dp->arg, key, scopeid);
276#else
277 nh = lookup_nhop(fibnum, dst6, scopeid);
278#endif
279 if (nh != NULL)
280 return (check_urpf(nh, flags, src_if));
281 return (0);
282}
283
284/*
285 * Function returning prefix match data along with the nexthop data.

Callers 2

pf_routableFunction · 0.85
in6_gif_lookupFunction · 0.85

Calls 2

lookup_nhopFunction · 0.70
check_urpfFunction · 0.70

Tested by

no test coverage detected