diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2025-05-22 08:25:55 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2025-05-27 09:47:43 +0000 |
| commit | 23d8e956fbe29418d74b78d98a453fcec1ad16da (patch) | |
| tree | 65a2518d10ccd6869ee4ec3e35f4f05d3412427e /sys/netinet6 | |
| parent | d67f1132f0181af3ca6502c562e7fb00ad4deecd (diff) | |
Diffstat (limited to 'sys/netinet6')
| -rw-r--r-- | sys/netinet6/icmp6.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index eaf8514fd5cf..9ea640fd24c8 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2391,7 +2391,7 @@ void icmp6_redirect_output(struct mbuf *m0, struct nhop_object *nh) { struct ifnet *ifp; /* my outgoing interface */ - struct in6_addr *ifp_ll6; + struct in6_addr ifp_ll6; struct in6_addr *router_ll6; struct ip6_hdr *sip6; /* m0 as struct ip6_hdr */ struct mbuf *m = NULL; /* newly allocated one */ @@ -2461,8 +2461,7 @@ icmp6_redirect_output(struct mbuf *m0, struct nhop_object *nh) IN6_IFF_NOTREADY| IN6_IFF_ANYCAST)) == NULL) goto fail; - ifp_ll6 = &ia->ia_addr.sin6_addr; - /* XXXRW: reference released prematurely. */ + bcopy(&ia->ia_addr.sin6_addr, &ifp_ll6, sizeof(ifp_ll6)); ifa_free(&ia->ia_ifa); } @@ -2485,7 +2484,7 @@ icmp6_redirect_output(struct mbuf *m0, struct nhop_object *nh) ip6->ip6_nxt = IPPROTO_ICMPV6; ip6->ip6_hlim = 255; /* ip6->ip6_src must be linklocal addr for my outgoing if. */ - bcopy(ifp_ll6, &ip6->ip6_src, sizeof(struct in6_addr)); + bcopy(&ifp_ll6, &ip6->ip6_src, sizeof(struct in6_addr)); bcopy(&sip6->ip6_src, &ip6->ip6_dst, sizeof(struct in6_addr)); /* ND Redirect */ |
