Fix lookup key generation in fib6_check_urpf().
The version introduced in r359823 assumed D23051 had been in tree already. As this is not the case yet, revert to sockaddr.
This commit is contained in:
parent
72a600a7a1
commit
d98351e13c
@ -362,7 +362,7 @@ fib6_check_urpf(uint32_t fibnum, const struct in6_addr *dst6,
|
|||||||
struct rib_head *rh;
|
struct rib_head *rh;
|
||||||
struct radix_node *rn;
|
struct radix_node *rn;
|
||||||
struct rtentry *rt;
|
struct rtentry *rt;
|
||||||
struct in6_addr addr;
|
struct sockaddr_in6 sin6;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
KASSERT((fibnum < rt_numfibs), ("fib6_check_urpf: bad fibnum"));
|
KASSERT((fibnum < rt_numfibs), ("fib6_check_urpf: bad fibnum"));
|
||||||
@ -370,13 +370,18 @@ fib6_check_urpf(uint32_t fibnum, const struct in6_addr *dst6,
|
|||||||
if (rh == NULL)
|
if (rh == NULL)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
addr = *dst6;
|
/* TODO: radix changes */
|
||||||
|
/* Prepare lookup key */
|
||||||
|
memset(&sin6, 0, sizeof(sin6));
|
||||||
|
sin6.sin6_len = sizeof(struct sockaddr_in6);
|
||||||
|
sin6.sin6_addr = *dst6;
|
||||||
|
|
||||||
/* Assume scopeid is valid and embed it directly */
|
/* Assume scopeid is valid and embed it directly */
|
||||||
if (IN6_IS_SCOPE_LINKLOCAL(dst6))
|
if (IN6_IS_SCOPE_LINKLOCAL(dst6))
|
||||||
addr.s6_addr16[1] = htons(scopeid & 0xffff);
|
sin6.sin6_addr.s6_addr16[1] = htons(scopeid & 0xffff);
|
||||||
|
|
||||||
RIB_RLOCK(rh);
|
RIB_RLOCK(rh);
|
||||||
rn = rh->rnh_matchaddr((void *)&addr, &rh->head);
|
rn = rh->rnh_matchaddr((void *)&sin6, &rh->head);
|
||||||
if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) {
|
if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) {
|
||||||
rt = RNTORT(rn);
|
rt = RNTORT(rn);
|
||||||
#ifdef RADIX_MPATH
|
#ifdef RADIX_MPATH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user