Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys PR/47058: Antti Kantee: If the ipv6 flow code modifies t...
details: https://anonhg.NetBSD.org/src/rev/adad5fe72f75
branches: trunk
changeset: 781991:adad5fe72f75
user: christos <christos%NetBSD.org@localhost>
date: Thu Oct 11 20:05:50 2012 +0000
description:
PR/47058: Antti Kantee: If the ipv6 flow code modifies the mbuf, pass the
change up to the caller.
diffstat:
sys/net/if_atmsubr.c | 6 +++---
sys/net/if_ethersubr.c | 6 +++---
sys/net/if_fddisubr.c | 6 +++---
sys/net/if_ppp.c | 6 +++---
sys/netinet6/in6_var.h | 4 ++--
sys/netinet6/ip6_flow.c | 12 ++++++++----
6 files changed, 22 insertions(+), 18 deletions(-)
diffs (188 lines):
diff -r b44baf59cc62 -r adad5fe72f75 sys/net/if_atmsubr.c
--- a/sys/net/if_atmsubr.c Thu Oct 11 18:05:40 2012 +0000
+++ b/sys/net/if_atmsubr.c Thu Oct 11 20:05:50 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_atmsubr.c,v 1.49 2011/02/01 19:46:28 chuck Exp $ */
+/* $NetBSD: if_atmsubr.c,v 1.50 2012/10/11 20:05:50 christos Exp $ */
/*
* Copyright (c) 1996 Charles D. Cranor and Washington University.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atmsubr.c,v 1.49 2011/02/01 19:46:28 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atmsubr.c,v 1.50 2012/10/11 20:05:50 christos Exp $");
#include "opt_inet.h"
#include "opt_gateway.h"
@@ -288,7 +288,7 @@
#ifdef INET6
case ETHERTYPE_IPV6:
#ifdef GATEWAY
- if (ip6flow_fastforward(m))
+ if (ip6flow_fastforward(&m))
return;
#endif
schednetisr(NETISR_IPV6);
diff -r b44baf59cc62 -r adad5fe72f75 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c Thu Oct 11 18:05:40 2012 +0000
+++ b/sys/net/if_ethersubr.c Thu Oct 11 20:05:50 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ethersubr.c,v 1.191 2012/10/05 04:26:06 matt Exp $ */
+/* $NetBSD: if_ethersubr.c,v 1.192 2012/10/11 20:05:50 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.191 2012/10/05 04:26:06 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.192 2012/10/11 20:05:50 christos Exp $");
#include "opt_inet.h"
#include "opt_atalk.h"
@@ -915,7 +915,7 @@
#ifdef INET6
case ETHERTYPE_IPV6:
#ifdef GATEWAY
- if (ip6flow_fastforward(m))
+ if (ip6flow_fastforward(&m))
return;
#endif
schednetisr(NETISR_IPV6);
diff -r b44baf59cc62 -r adad5fe72f75 sys/net/if_fddisubr.c
--- a/sys/net/if_fddisubr.c Thu Oct 11 18:05:40 2012 +0000
+++ b/sys/net/if_fddisubr.c Thu Oct 11 20:05:50 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_fddisubr.c,v 1.81 2010/04/05 07:22:23 joerg Exp $ */
+/* $NetBSD: if_fddisubr.c,v 1.82 2012/10/11 20:05:50 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.81 2010/04/05 07:22:23 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.82 2012/10/11 20:05:50 christos Exp $");
#include "opt_gateway.h"
#include "opt_inet.h"
@@ -648,7 +648,7 @@
#ifdef INET6
case ETHERTYPE_IPV6:
#ifdef GATEWAY
- if (ip6flow_fastforward(m))
+ if (ip6flow_fastforward(&m))
return;
#endif
schednetisr(NETISR_IPV6);
diff -r b44baf59cc62 -r adad5fe72f75 sys/net/if_ppp.c
--- a/sys/net/if_ppp.c Thu Oct 11 18:05:40 2012 +0000
+++ b/sys/net/if_ppp.c Thu Oct 11 20:05:50 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ppp.c,v 1.136 2011/10/28 22:08:14 dyoung Exp $ */
+/* $NetBSD: if_ppp.c,v 1.137 2012/10/11 20:05:50 christos Exp $ */
/* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */
/*
@@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.136 2011/10/28 22:08:14 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.137 2012/10/11 20:05:50 christos Exp $");
#include "ppp.h"
@@ -1645,7 +1645,7 @@
m->m_data += PPP_HDRLEN;
m->m_len -= PPP_HDRLEN;
#ifdef GATEWAY
- if (ip6flow_fastforward(m))
+ if (ip6flow_fastforward(&m))
return;
#endif
schednetisr(NETISR_IPV6);
diff -r b44baf59cc62 -r adad5fe72f75 sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h Thu Oct 11 18:05:40 2012 +0000
+++ b/sys/netinet6/in6_var.h Thu Oct 11 20:05:50 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_var.h,v 1.65 2012/06/23 03:14:03 christos Exp $ */
+/* $NetBSD: in6_var.h,v 1.66 2012/10/11 20:05:50 christos Exp $ */
/* $KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $ */
/*
@@ -703,7 +703,7 @@
void in6_prefixlen2mask(struct in6_addr *, int);
void in6_purgeprefix(struct ifnet *);
-int ip6flow_fastforward(struct mbuf *); /* IPv6 fast forward routine */
+int ip6flow_fastforward(struct mbuf **); /* IPv6 fast forward routine */
int in6_src_ioctl(u_long, void *);
int in6_is_addr_deprecated(struct sockaddr_in6 *);
diff -r b44baf59cc62 -r adad5fe72f75 sys/netinet6/ip6_flow.c
--- a/sys/netinet6/ip6_flow.c Thu Oct 11 18:05:40 2012 +0000
+++ b/sys/netinet6/ip6_flow.c Thu Oct 11 20:05:50 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_flow.c,v 1.19 2012/01/19 13:19:34 liamjfoy Exp $ */
+/* $NetBSD: ip6_flow.c,v 1.20 2012/10/11 20:05:50 christos Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_flow.c,v 1.19 2012/01/19 13:19:34 liamjfoy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_flow.c,v 1.20 2012/10/11 20:05:50 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,7 +74,7 @@
* using the cached details.
*
* Example:
- * ether/fddi_input -> ip6flow_fastfoward -> if_output
+ * ether/fddi_input -> ip6flow_fastforward -> if_output
*/
static struct pool ip6flow_pool;
@@ -208,11 +208,12 @@
* routine to deal with.
*/
int
-ip6flow_fastforward(struct mbuf *m)
+ip6flow_fastforward(struct mbuf **mp)
{
struct ip6flow *ip6f;
struct ip6_hdr *ip6;
struct rtentry *rt;
+ struct mbuf *m;
const struct sockaddr *dst;
int error;
@@ -222,6 +223,7 @@
if (!ip6_forwarding || ip6flow_inuse == 0)
return 0;
+ m = *mp;
/*
* At least size of IPv6 Header?
*/
@@ -239,10 +241,12 @@
(max_linkhdr + 3) & ~3)) == NULL) {
return 0;
}
+ *mp = m;
} else if (__predict_false(m->m_len < sizeof(struct ip6_hdr))) {
if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) {
return 0;
}
+ *mp = m;
}
ip6 = mtod(m, struct ip6_hdr *);
Home |
Main Index |
Thread Index |
Old Index