Module Name: src Committed By: christos Date: Thu Oct 11 20:05:50 UTC 2012
Modified Files: src/sys/net: if_atmsubr.c if_ethersubr.c if_fddisubr.c if_ppp.c src/sys/netinet6: in6_var.h ip6_flow.c Log Message: 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.50 src/sys/net/if_atmsubr.c cvs rdiff -u -r1.191 -r1.192 src/sys/net/if_ethersubr.c cvs rdiff -u -r1.81 -r1.82 src/sys/net/if_fddisubr.c cvs rdiff -u -r1.136 -r1.137 src/sys/net/if_ppp.c cvs rdiff -u -r1.65 -r1.66 src/sys/netinet6/in6_var.h cvs rdiff -u -r1.19 -r1.20 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.50 --- src/sys/net/if_atmsubr.c:1.49 Tue Feb 1 14:46:28 2011 +++ src/sys/net/if_atmsubr.c Thu Oct 11 16:05:50 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.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 @@ 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.191 src/sys/net/if_ethersubr.c:1.192 --- src/sys/net/if_ethersubr.c:1.191 Fri Oct 5 00:26:06 2012 +++ src/sys/net/if_ethersubr.c Thu Oct 11 16:05:50 2012 @@ -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 @@ 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.82 --- src/sys/net/if_fddisubr.c:1.81 Mon Apr 5 03:22:23 2010 +++ src/sys/net/if_fddisubr.c Thu Oct 11 16:05:50 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.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 @@ 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.137 --- src/sys/net/if_ppp.c:1.136 Fri Oct 28 18:08:14 2011 +++ src/sys/net/if_ppp.c Thu Oct 11 16:05:50 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.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 @@ 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.65 src/sys/netinet6/in6_var.h:1.66 --- src/sys/netinet6/in6_var.h:1.65 Fri Jun 22 23:14:03 2012 +++ src/sys/netinet6/in6_var.h Thu Oct 11 16:05:50 2012 @@ -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 @@ 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.20 --- src/sys/netinet6/ip6_flow.c:1.19 Thu Jan 19 08:19:34 2012 +++ src/sys/netinet6/ip6_flow.c Thu Oct 11 16:05:50 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.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 @@ __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 *);