git: 4861df17a2af - stable/13 - ipv6: Fix getsockopt() for some IPPROTO_IPV6 level socket options

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Tue, 22 Feb 2022 22:33:31 UTC
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=4861df17a2afe81f3fb65bac9f1f992446244bc6

commit 4861df17a2afe81f3fb65bac9f1f992446244bc6
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-08-09 07:23:42 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-02-22 22:33:03 +0000

    ipv6: Fix getsockopt() for some IPPROTO_IPV6 level socket options
    
    Fix getsockopt() for the IPPROTO_IPV6 level socket options with the
    following names: IPV6_HOPOPTS, IPV6_RTHDR, IPV6_RTHDRDSTOPTS,
    IPV6_DSTOPTS, and IPV6_NEXTHOP.
    
    Reviewed by:            markj
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D31458
    
    (cherry picked from commit a8d54fc903cca354572ddd7a890baefd81baa7e8)
---
 sys/netinet6/ip6_output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index de9ed673de79..877d9db508c7 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -2572,7 +2572,7 @@ ip6_pcbopt(int optname, u_char *buf, int len, struct ip6_pktopts **pktopt,
 		pktopt = inp->in6p_outputopts;					\
 		if (pktopt && pktopt->field) {					\
 			optdatalen = min(lenexpr, sopt->sopt_valsize);		\
-			bcopy(&pktopt->field, optdata, optdatalen);		\
+			bcopy(pktopt->field, optdata, optdatalen);		\
 		} else {							\
 			free(optdata, M_TEMP);					\
 			optdata = NULL;						\