nd6: Avoid using an uninitialized sockaddr in nd6_prefix_offlink()
Commit 81728a538 ("Split rtinit() into multiple functions.") removed the initialization of sa6, but not one of its uses. This meant that we were passing an uninitialized sockaddr as the address to lltable_prefix_free(). Remove the variable outright to fix the problem. The caller is expected to hold a reference on pr. Fixes: 81728a538 ("Split rtinit() into multiple functions.") Reported by: KMSAN Reviewed by: donner MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30166
This commit is contained in:
parent
ad22ba2b9f
commit
c1dd4d642f
@ -2165,7 +2165,6 @@ nd6_prefix_offlink(struct nd_prefix *pr)
|
||||
int error = 0;
|
||||
struct ifnet *ifp = pr->ndpr_ifp;
|
||||
struct nd_prefix *opr;
|
||||
struct sockaddr_in6 sa6;
|
||||
char ip6buf[INET6_ADDRSTRLEN];
|
||||
uint64_t genid;
|
||||
int a_failure;
|
||||
@ -2240,7 +2239,8 @@ restart:
|
||||
}
|
||||
|
||||
if (a_failure)
|
||||
lltable_prefix_free(AF_INET6, (struct sockaddr *)&sa6,
|
||||
lltable_prefix_free(AF_INET6,
|
||||
(struct sockaddr *)&pr->ndpr_prefix,
|
||||
(struct sockaddr *)&mask6, LLE_STATIC);
|
||||
|
||||
return (error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user