Module Name:    src
Committed By:   riz
Date:           Wed Oct 31 16:07:46 UTC 2012

Modified Files:
        src/sys/net [netbsd-6]: if_atmsubr.c if_ethersubr.c if_fddisubr.c
            if_ppp.c
        src/sys/netinet6 [netbsd-6]: in6_var.h ip6_flow.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #638):
        sys/net/if_ppp.c: revision 1.137
        sys/netinet6/ip6_flow.c: revision 1.20
        sys/net/if_fddisubr.c: revision 1.82
        sys/net/if_ethersubr.c: revision 1.192
        sys/netinet6/in6_var.h: revision 1.66
        sys/net/if_atmsubr.c: revision 1.50
PR/47058: Antti Kantee: If the ipv6 flow code modifies the mbuf, pass the
change up to the caller.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.49.10.1 src/sys/net/if_atmsubr.c
cvs rdiff -u -r1.188.8.2 -r1.188.8.3 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.81 -r1.81.14.1 src/sys/net/if_fddisubr.c
cvs rdiff -u -r1.136 -r1.136.8.1 src/sys/net/if_ppp.c
cvs rdiff -u -r1.64 -r1.64.20.1 src/sys/netinet6/in6_var.h
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/netinet6/ip6_flow.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_atmsubr.c
diff -u src/sys/net/if_atmsubr.c:1.49 src/sys/net/if_atmsubr.c:1.49.10.1
--- src/sys/net/if_atmsubr.c:1.49	Tue Feb  1 19:46:28 2011
+++ src/sys/net/if_atmsubr.c	Wed Oct 31 16:07:46 2012
@@ -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.49.10.1 2012/10/31 16:07:46 riz 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.49.10.1 2012/10/31 16:07:46 riz Exp $");
 
 #include "opt_inet.h"
 #include "opt_gateway.h"
@@ -288,7 +288,7 @@ atm_input(struct ifnet *ifp, struct atm_
 #ifdef INET6
 	  case ETHERTYPE_IPV6:
 #ifdef GATEWAY  
-		if (ip6flow_fastforward(m))
+		if (ip6flow_fastforward(&m))
 			return;
 #endif
 		  schednetisr(NETISR_IPV6);

Index: src/sys/net/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.188.8.2 src/sys/net/if_ethersubr.c:1.188.8.3
--- src/sys/net/if_ethersubr.c:1.188.8.2	Mon Aug 20 19:23:07 2012
+++ src/sys/net/if_ethersubr.c	Wed Oct 31 16:07:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.188.8.2 2012/08/20 19:23:07 riz Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.188.8.3 2012/10/31 16:07:46 riz 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.188.8.2 2012/08/20 19:23:07 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.188.8.3 2012/10/31 16:07:46 riz Exp $");
 
 #include "opt_inet.h"
 #include "opt_atalk.h"
@@ -915,7 +915,7 @@ ether_input(struct ifnet *ifp, struct mb
 #ifdef INET6
 		case ETHERTYPE_IPV6:
 #ifdef GATEWAY  
-			if (ip6flow_fastforward(m))
+			if (ip6flow_fastforward(&m))
 				return;
 #endif
 			schednetisr(NETISR_IPV6);

Index: src/sys/net/if_fddisubr.c
diff -u src/sys/net/if_fddisubr.c:1.81 src/sys/net/if_fddisubr.c:1.81.14.1
--- src/sys/net/if_fddisubr.c:1.81	Mon Apr  5 07:22:23 2010
+++ src/sys/net/if_fddisubr.c	Wed Oct 31 16:07:46 2012
@@ -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.81.14.1 2012/10/31 16:07:46 riz 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.81.14.1 2012/10/31 16:07:46 riz Exp $");
 
 #include "opt_gateway.h"
 #include "opt_inet.h"
@@ -648,7 +648,7 @@ fddi_input(struct ifnet *ifp, struct mbu
 #ifdef INET6
 		case ETHERTYPE_IPV6:
 #ifdef GATEWAY  
-			if (ip6flow_fastforward(m))
+			if (ip6flow_fastforward(&m))
 				return;
 #endif
 			schednetisr(NETISR_IPV6);

Index: src/sys/net/if_ppp.c
diff -u src/sys/net/if_ppp.c:1.136 src/sys/net/if_ppp.c:1.136.8.1
--- src/sys/net/if_ppp.c:1.136	Fri Oct 28 22:08:14 2011
+++ src/sys/net/if_ppp.c	Wed Oct 31 16:07:46 2012
@@ -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.136.8.1 2012/10/31 16:07:46 riz 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.136.8.1 2012/10/31 16:07:46 riz Exp $");
 
 #include "ppp.h"
 
@@ -1645,7 +1645,7 @@ ppp_inproc(struct ppp_softc *sc, struct 
 	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);

Index: src/sys/netinet6/in6_var.h
diff -u src/sys/netinet6/in6_var.h:1.64 src/sys/netinet6/in6_var.h:1.64.20.1
--- src/sys/netinet6/in6_var.h:1.64	Thu Jan 15 23:22:15 2009
+++ src/sys/netinet6/in6_var.h	Wed Oct 31 16:07:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_var.h,v 1.64 2009/01/15 23:22:15 christos Exp $	*/
+/*	$NetBSD: in6_var.h,v 1.64.20.1 2012/10/31 16:07:46 riz Exp $	*/
 /*	$KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -701,7 +701,7 @@ int	in6_are_prefix_equal(struct in6_addr
 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 *);

Index: src/sys/netinet6/ip6_flow.c
diff -u src/sys/netinet6/ip6_flow.c:1.19 src/sys/netinet6/ip6_flow.c:1.19.2.1
--- src/sys/netinet6/ip6_flow.c:1.19	Thu Jan 19 13:19:34 2012
+++ src/sys/netinet6/ip6_flow.c	Wed Oct 31 16:07:46 2012
@@ -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.19.2.1 2012/10/31 16:07:46 riz 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.19.2.1 2012/10/31 16:07:46 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip6_flow.c,v
  * 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 @@ ip6flow_init(int table_size)
  * 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 @@ ip6flow_fastforward(struct mbuf *m)
 	if (!ip6_forwarding || ip6flow_inuse == 0)
 		return 0;
 
+	m = *mp;
 	/*
 	 * At least size of IPv6 Header?
 	 */
@@ -239,10 +241,12 @@ ip6flow_fastforward(struct mbuf *m)
 				(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 *);

Reply via email to