summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_pcb.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2023-11-28 13:23:21 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2023-11-28 13:23:21 +0000
commit4b29b6817dd3dbbdce9da388108c795f403a4973 (patch)
tree114dcc0e12733e67d61b67f183cbe52db5538341 /sys/netinet6/in6_pcb.c
parentd7785c2ebe5dcb50b51336f4888dba90a71b0f01 (diff)
Remove struct inpcb from in6_embedscope() parameters.
rip6_output() did modify inp_outputopts6 temporarily to provide different ip6_pktopts to in6_embedscope(). Better pass inp_outputopts6 and inp_moptions6 as separate arguments to in6_embedscope(). Simplify the code that deals with these options in in6_embedscope(). Doucument inp_moptions and inp_moptions6 as protected by net lock. OK kn@
Diffstat (limited to 'sys/netinet6/in6_pcb.c')
-rw-r--r--sys/netinet6/in6_pcb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index 5feb33c820c..dc7e6144801 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_pcb.c,v 1.124 2023/06/24 20:54:46 bluhm Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.125 2023/11/28 13:23:20 bluhm Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -157,7 +157,8 @@ in6_pcbaddrisavail(struct inpcb *inp, struct sockaddr_in6 *sin6, int wild,
wild |= INPLOOKUP_IPV6;
/* KAME hack: embed scopeid */
- if (in6_embedscope(&sin6->sin6_addr, sin6, inp) != 0)
+ if (in6_embedscope(&sin6->sin6_addr, sin6,
+ inp->inp_outputopts6, inp->inp_moptions6) != 0)
return (EINVAL);
/* this must be cleared for ifa_ifwithaddr() */
sin6->sin6_scope_id = 0;
@@ -265,8 +266,9 @@ in6_pcbconnect(struct inpcb *inp, struct mbuf *nam)
sin6 = &tmp;
/* KAME hack: embed scopeid */
- if (in6_embedscope(&sin6->sin6_addr, sin6, inp) != 0)
- return EINVAL;
+ if (in6_embedscope(&sin6->sin6_addr, sin6,
+ inp->inp_outputopts6, inp->inp_moptions6) != 0)
+ return (EINVAL);
/* this must be cleared for ifa_ifwithaddr() */
sin6->sin6_scope_id = 0;