ip6_forward.c (188306) | ip6_forward.c (195699) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet6/ip6_forward.c 188306 2009-02-08 09:27:07Z bz $"); | 33__FBSDID("$FreeBSD: head/sys/netinet6/ip6_forward.c 195699 2009-07-14 22:48:30Z rwatson $"); |
34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38#include "opt_ipstealth.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> --- 18 unchanged lines hidden (view full) --- 60#include <netinet/ip.h> 61#include <netinet/ip_var.h> 62#include <netinet6/in6_var.h> 63#include <netinet/ip6.h> 64#include <netinet6/ip6_var.h> 65#include <netinet6/scope6_var.h> 66#include <netinet/icmp6.h> 67#include <netinet6/nd6.h> | 34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38#include "opt_ipstealth.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> --- 18 unchanged lines hidden (view full) --- 60#include <netinet/ip.h> 61#include <netinet/ip_var.h> 62#include <netinet6/in6_var.h> 63#include <netinet/ip6.h> 64#include <netinet6/ip6_var.h> 65#include <netinet6/scope6_var.h> 66#include <netinet/icmp6.h> 67#include <netinet6/nd6.h> |
68#include <netinet6/vinet6.h> | |
69 70#include <netinet/in_pcb.h> 71 72#ifdef IPSEC 73#include <netipsec/ipsec.h> 74#include <netipsec/ipsec6.h> 75#include <netipsec/key.h> 76#endif /* IPSEC */ --- 10 unchanged lines hidden (view full) --- 87 * if ipforwarding was zero but some routing protocol was advancing 88 * us as a gateway to somewhere. However, we must let the routing 89 * protocol deal with that. 90 * 91 */ 92void 93ip6_forward(struct mbuf *m, int srcrt) 94{ | 68 69#include <netinet/in_pcb.h> 70 71#ifdef IPSEC 72#include <netipsec/ipsec.h> 73#include <netipsec/ipsec6.h> 74#include <netipsec/key.h> 75#endif /* IPSEC */ --- 10 unchanged lines hidden (view full) --- 86 * if ipforwarding was zero but some routing protocol was advancing 87 * us as a gateway to somewhere. However, we must let the routing 88 * protocol deal with that. 89 * 90 */ 91void 92ip6_forward(struct mbuf *m, int srcrt) 93{ |
95 INIT_VNET_INET6(curvnet); | |
96 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); 97 struct sockaddr_in6 *dst = NULL; 98 struct rtentry *rt = NULL; 99 struct route_in6 rin6; 100 int error, type = 0, code = 0; 101 struct mbuf *mcopy = NULL; 102 struct ifnet *origifp; /* maybe unnecessary */ 103 u_int32_t inzone, outzone; 104 struct in6_addr src_in6, dst_in6; 105#ifdef IPSEC | 94 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); 95 struct sockaddr_in6 *dst = NULL; 96 struct rtentry *rt = NULL; 97 struct route_in6 rin6; 98 int error, type = 0, code = 0; 99 struct mbuf *mcopy = NULL; 100 struct ifnet *origifp; /* maybe unnecessary */ 101 u_int32_t inzone, outzone; 102 struct in6_addr src_in6, dst_in6; 103#ifdef IPSEC |
106 INIT_VNET_IPSEC(curvnet); | |
107 struct secpolicy *sp = NULL; 108 int ipsecrt = 0; 109#endif 110 char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; 111 112#ifdef IPSEC 113 /* 114 * Check AH/ESP integrity. --- 514 unchanged lines hidden --- | 104 struct secpolicy *sp = NULL; 105 int ipsecrt = 0; 106#endif 107 char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; 108 109#ifdef IPSEC 110 /* 111 * Check AH/ESP integrity. --- 514 unchanged lines hidden --- |