ip_icmp.c (82884) | ip_icmp.c (83934) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 |
34 * $FreeBSD: head/sys/netinet/ip_icmp.c 82884 2001-09-03 20:03:55Z julian $ | 34 * $FreeBSD: head/sys/netinet/ip_icmp.c 83934 2001-09-25 18:40:52Z brooks $ |
35 */ 36 37#include "opt_ipsec.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/mbuf.h> 42#include <sys/protosw.h> 43#include <sys/socket.h> 44#include <sys/time.h> 45#include <sys/kernel.h> 46#include <sys/sysctl.h> 47 48#include <net/if.h> | 35 */ 36 37#include "opt_ipsec.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/mbuf.h> 42#include <sys/protosw.h> 43#include <sys/socket.h> 44#include <sys/time.h> 45#include <sys/kernel.h> 46#include <sys/sysctl.h> 47 48#include <net/if.h> |
49#include <net/if_types.h> |
|
49#include <net/route.h> 50 51#define _IP_VHL 52#include <netinet/in.h> 53#include <netinet/in_systm.h> 54#include <netinet/in_var.h> 55#include <netinet/ip.h> 56#include <netinet/ip_icmp.h> 57#include <netinet/ip_var.h> 58#include <netinet/icmp_var.h> 59 60#ifdef IPSEC 61#include <netinet6/ipsec.h> 62#include <netkey/key.h> 63#endif 64 | 50#include <net/route.h> 51 52#define _IP_VHL 53#include <netinet/in.h> 54#include <netinet/in_systm.h> 55#include <netinet/in_var.h> 56#include <netinet/ip.h> 57#include <netinet/ip_icmp.h> 58#include <netinet/ip_var.h> 59#include <netinet/icmp_var.h> 60 61#ifdef IPSEC 62#include <netinet6/ipsec.h> 63#include <netkey/key.h> 64#endif 65 |
65#include "faith.h" 66#if defined(NFAITH) && NFAITH > 0 67#include <net/if_types.h> 68#endif 69 | |
70#include <machine/in_cksum.h> 71 72/* 73 * ICMP routines: error generation, receive packet processing, and 74 * routines to turnaround packets back to the originator, and 75 * host table maintenance routines. 76 */ 77 --- 192 unchanged lines hidden (view full) --- 270 icp = mtod(m, struct icmp *); 271 if (in_cksum(m, icmplen)) { 272 icmpstat.icps_checksum++; 273 goto freeit; 274 } 275 m->m_len += hlen; 276 m->m_data -= hlen; 277 | 66#include <machine/in_cksum.h> 67 68/* 69 * ICMP routines: error generation, receive packet processing, and 70 * routines to turnaround packets back to the originator, and 71 * host table maintenance routines. 72 */ 73 --- 192 unchanged lines hidden (view full) --- 266 icp = mtod(m, struct icmp *); 267 if (in_cksum(m, icmplen)) { 268 icmpstat.icps_checksum++; 269 goto freeit; 270 } 271 m->m_len += hlen; 272 m->m_data -= hlen; 273 |
278#if defined(NFAITH) && 0 < NFAITH | |
279 if (m->m_pkthdr.rcvif && m->m_pkthdr.rcvif->if_type == IFT_FAITH) { 280 /* 281 * Deliver very specific ICMP type only. 282 */ 283 switch (icp->icmp_type) { 284 case ICMP_UNREACH: 285 case ICMP_TIMXCEED: 286 break; 287 default: 288 goto freeit; 289 } 290 } | 274 if (m->m_pkthdr.rcvif && m->m_pkthdr.rcvif->if_type == IFT_FAITH) { 275 /* 276 * Deliver very specific ICMP type only. 277 */ 278 switch (icp->icmp_type) { 279 case ICMP_UNREACH: 280 case ICMP_TIMXCEED: 281 break; 282 default: 283 goto freeit; 284 } 285 } |
291#endif | |
292 293#ifdef ICMPPRINTFS 294 if (icmpprintfs) 295 printf("icmp_input, type %d code %d\n", icp->icmp_type, 296 icp->icmp_code); 297#endif 298 299 /* --- 570 unchanged lines hidden --- | 286 287#ifdef ICMPPRINTFS 288 if (icmpprintfs) 289 printf("icmp_input, type %d code %d\n", icp->icmp_type, 290 icp->icmp_code); 291#endif 292 293 /* --- 570 unchanged lines hidden --- |