mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
nd6: Avoid using an uninitialized sockaddr in nd6_prefix_offlink()
Commit81728a538("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
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Reference in a new issue