summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-11-21 20:15:45 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-11-21 20:15:45 +0000
commitd6744a16d52baa1967f04a18aecbb360a0e49109 (patch)
tree70bea1acc573ef2a44dd85f5c429f7b6444557e9 /sys/netinet6
parent6a3219c3a27121f6f51a6425bb76d36de7853e72 (diff)
During IP deliver, propagate correct address family.
If ip_deliver() changes the af, e.g. for ip6 over ip4, then it cannot rely on the caller ip_ours() to enqueue the packet in the correct queue. ip_deliver() has to do the enqueue depending on the changed af. from markus@
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_input.c8
-rw-r--r--sys/netinet6/ip6_var.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 79ba290503f..6768e4d2533 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_input.c,v 1.266 2024/07/19 16:58:32 bluhm Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.267 2024/11/21 20:15:44 bluhm Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -189,6 +189,12 @@ ip6_ours(struct mbuf **mp, int *offp, int nxt, int af, int flags)
if (nxt == IPPROTO_DONE)
return IPPROTO_DONE;
+ return ip6_ours_enqueue(mp, offp, nxt);
+}
+
+int
+ip6_ours_enqueue(struct mbuf **mp, int *offp, int nxt)
+{
/* save values for later, use after dequeue */
if (*offp != sizeof(struct ip6_hdr)) {
struct m_tag *mtag;
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index 1ddbb4b1c0c..e59c8b0ed60 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_var.h,v 1.120 2024/07/12 19:50:35 bluhm Exp $ */
+/* $OpenBSD: ip6_var.h,v 1.121 2024/11/21 20:15:44 bluhm Exp $ */
/* $KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $ */
/*
@@ -311,6 +311,7 @@ int icmp6_ctloutput(int, struct socket *, int, int, struct mbuf *);
void ip6_init(void);
void ip6intr(void);
int ip6_input_if(struct mbuf **, int *, int, int, struct ifnet *);
+int ip6_ours_enqueue(struct mbuf **, int *, int);
void ip6_freepcbopts(struct ip6_pktopts *);
void ip6_freemoptions(struct ip6_moptions *);
int ip6_unknown_opt(struct mbuf **, u_int8_t *, int);