* 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. */
| 250 | * Returns 1 if route matching conditions is found, 0 otherwise. |
| 251 | */ |
| 252 | int |
| 253 | fib4_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. |
no test coverage detected