ip6_forward.c (148385) | ip6_forward.c (148921) |
---|---|
1/* $FreeBSD: head/sys/netinet6/ip6_forward.c 148385 2005-07-25 12:31:43Z ume $ */ | 1/* $FreeBSD: head/sys/netinet6/ip6_forward.c 148921 2005-08-10 09:13:35Z suz $ */ |
2/* $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include "opt_ip6fw.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipsec.h" | 2/* $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include "opt_ip6fw.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipsec.h" |
37#include "opt_ipstealth.h" |
|
37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/malloc.h> 41#include <sys/mbuf.h> 42#include <sys/domain.h> 43#include <sys/protosw.h> 44#include <sys/socket.h> --- 111 unchanged lines hidden (view full) --- 156 ip6_sprintf(&ip6->ip6_dst), 157 ip6->ip6_nxt, 158 if_name(m->m_pkthdr.rcvif)); 159 } 160 m_freem(m); 161 return; 162 } 163 | 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> 42#include <sys/mbuf.h> 43#include <sys/domain.h> 44#include <sys/protosw.h> 45#include <sys/socket.h> --- 111 unchanged lines hidden (view full) --- 157 ip6_sprintf(&ip6->ip6_dst), 158 ip6->ip6_nxt, 159 if_name(m->m_pkthdr.rcvif)); 160 } 161 m_freem(m); 162 return; 163 } 164 |
165#ifdef IPSTEALTH 166 if (!ip6stealth) { 167#endif |
|
164 if (ip6->ip6_hlim <= IPV6_HLIMDEC) { 165 /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */ 166 icmp6_error(m, ICMP6_TIME_EXCEEDED, 167 ICMP6_TIME_EXCEED_TRANSIT, 0); 168 return; 169 } 170 ip6->ip6_hlim -= IPV6_HLIMDEC; 171 | 168 if (ip6->ip6_hlim <= IPV6_HLIMDEC) { 169 /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */ 170 icmp6_error(m, ICMP6_TIME_EXCEEDED, 171 ICMP6_TIME_EXCEED_TRANSIT, 0); 172 return; 173 } 174 ip6->ip6_hlim -= IPV6_HLIMDEC; 175 |
176#ifdef IPSTEALTH 177 } 178#endif 179 |
|
172 /* 173 * Save at most ICMPV6_PLD_MAXLEN (= the min IPv6 MTU - 174 * size of IPv6 + ICMPv6 headers) bytes of the packet in case 175 * we need to generate an ICMP6 message to the src. 176 * Thanks to M_EXT, in most cases copy will not occur. 177 * 178 * It is important to save it before IPsec processing as IPsec 179 * processing may modify the mbuf. --- 488 unchanged lines hidden --- | 180 /* 181 * Save at most ICMPV6_PLD_MAXLEN (= the min IPv6 MTU - 182 * size of IPv6 + ICMPv6 headers) bytes of the packet in case 183 * we need to generate an ICMP6 message to the src. 184 * Thanks to M_EXT, in most cases copy will not occur. 185 * 186 * It is important to save it before IPsec processing as IPsec 187 * processing may modify the mbuf. --- 488 unchanged lines hidden --- |