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

Function fib4_check_urpf

freebsd/netinet/in_fib.c:252–269  ·  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

250 * Returns 1 if route matching conditions is found, 0 otherwise.
251 */
252int
253fib4_check_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid,
254 uint32_t flags, const struct ifnet *src_if)
255{
256 struct nhop_object *nh;
257#ifdef FIB_ALGO
258 struct fib_dp *dp = &V_inet_dp[fibnum];
259 struct flm_lookup_key key = {.addr4 = dst };
260
261 nh = dp->f(dp->arg, key, scopeid);
262#else
263 nh = lookup_nhop(fibnum, dst, scopeid);
264#endif
265 if (nh != NULL)
266 return (check_urpf(nh, flags, src_if));
267
268 return (0);
269}
270
271/*
272 * Function returning prefix match data along with the nexthop data.

Callers 2

pf_routableFunction · 0.85
in_gif_lookupFunction · 0.85

Calls 2

lookup_nhopFunction · 0.70
check_urpfFunction · 0.70

Tested by

no test coverage detected