diff options
| author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2021-08-30 21:10:37 +0000 |
|---|---|---|
| committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2021-09-07 21:02:59 +0000 |
| commit | 0e77fc2a79ed047cfddd0190795aff21dddf4a1c (patch) | |
| tree | 9ad47e70b261518dc4c5457c527108098ab1adf0 /sys/net | |
| parent | 4e97cbba1c79fc7c2a5ceeccefbea0f71887e915 (diff) | |
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/route/route_helpers.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/route/route_helpers.c b/sys/net/route/route_helpers.c index 569e13a308eb..0696eec416b1 100644 --- a/sys/net/route/route_helpers.c +++ b/sys/net/route/route_helpers.c @@ -434,6 +434,9 @@ get_inet_parent_prefix(uint32_t fibnum, struct in_addr addr, int plen) struct radix_node *rn; rt = fib4_lookup_rt(fibnum, addr, 0, NHR_UNLOCKED, &rnd); + if (rt == NULL) + return (NULL); + rt_get_inet_prefix_plen(rt, &addr4, &parent_plen, &scopeid); if (parent_plen <= plen) return (rt); @@ -503,6 +506,9 @@ get_inet6_parent_prefix(uint32_t fibnum, const struct in6_addr *paddr, int plen) struct radix_node *rn; rt = fib6_lookup_rt(fibnum, paddr, 0, NHR_UNLOCKED, &rnd); + if (rt == NULL) + return (NULL); + rt_get_inet6_prefix_plen(rt, &addr6, &parent_plen, &scopeid); if (parent_plen <= plen) return (rt); |
