Deleted Added
full compact
icmp6.c (79139) icmp6.c (83934)
1/* $FreeBSD: head/sys/netinet6/icmp6.c 79139 2001-07-03 11:54:07Z ume $ */
1/* $FreeBSD: head/sys/netinet6/icmp6.c 83934 2001-09-25 18:40:52Z brooks $ */
2/* $KAME: icmp6.c,v 1.211 2001/04/04 05:56:20 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

--- 88 unchanged lines hidden (view full) ---

98#include <netinet6/in6_ifattach.h>
99#include <netinet6/ip6protosw.h>
100
101#ifdef IPSEC
102#include <netinet6/ipsec.h>
103#include <netkey/key.h>
104#endif
105
2/* $KAME: icmp6.c,v 1.211 2001/04/04 05:56:20 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

--- 88 unchanged lines hidden (view full) ---

98#include <netinet6/in6_ifattach.h>
99#include <netinet6/ip6protosw.h>
100
101#ifdef IPSEC
102#include <netinet6/ipsec.h>
103#include <netkey/key.h>
104#endif
105
106#include "faith.h"
107#if defined(NFAITH) && 0 < NFAITH
108#include <net/if_faith.h>
109#endif
110
111#include <net/net_osdep.h>
112
113#ifdef HAVE_NRL_INPCB
114/* inpcb members */
115#define in6pcb inpcb
116#define in6p_laddr inp_laddr6
117#define in6p_faddr inp_faddr6
118#define in6p_icmp6filt inp_icmp6filt

--- 315 unchanged lines hidden (view full) ---

434 if ((sum = in6_cksum(m, IPPROTO_ICMPV6, off, icmp6len)) != 0) {
435 nd6log((LOG_ERR,
436 "ICMP6 checksum error(%d|%x) %s\n",
437 icmp6->icmp6_type, sum, ip6_sprintf(&ip6->ip6_src)));
438 icmp6stat.icp6s_checksum++;
439 goto freeit;
440 }
441
106#include <net/net_osdep.h>
107
108#ifdef HAVE_NRL_INPCB
109/* inpcb members */
110#define in6pcb inpcb
111#define in6p_laddr inp_laddr6
112#define in6p_faddr inp_faddr6
113#define in6p_icmp6filt inp_icmp6filt

--- 315 unchanged lines hidden (view full) ---

429 if ((sum = in6_cksum(m, IPPROTO_ICMPV6, off, icmp6len)) != 0) {
430 nd6log((LOG_ERR,
431 "ICMP6 checksum error(%d|%x) %s\n",
432 icmp6->icmp6_type, sum, ip6_sprintf(&ip6->ip6_src)));
433 icmp6stat.icp6s_checksum++;
434 goto freeit;
435 }
436
442#if defined(NFAITH) && 0 < NFAITH
443 if (faithprefix(&ip6->ip6_dst)) {
437 if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) {
444 /*
445 * Deliver very specific ICMP6 type only.
446 * This is important to deilver TOOBIG. Otherwise PMTUD
447 * will not work.
448 */
449 switch (icmp6->icmp6_type) {
450 case ICMP6_DST_UNREACH:
451 case ICMP6_PACKET_TOO_BIG:
452 case ICMP6_TIME_EXCEEDED:
453 break;
454 default:
455 goto freeit;
456 }
457 }
438 /*
439 * Deliver very specific ICMP6 type only.
440 * This is important to deilver TOOBIG. Otherwise PMTUD
441 * will not work.
442 */
443 switch (icmp6->icmp6_type) {
444 case ICMP6_DST_UNREACH:
445 case ICMP6_PACKET_TOO_BIG:
446 case ICMP6_TIME_EXCEEDED:
447 break;
448 default:
449 goto freeit;
450 }
451 }
458#endif
459
460 icmp6stat.icp6s_inhist[icmp6->icmp6_type]++;
461 icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_msg);
462 if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK)
463 icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_error);
464
465 switch (icmp6->icmp6_type) {
466 case ICMP6_DST_UNREACH:

--- 2408 unchanged lines hidden ---
452
453 icmp6stat.icp6s_inhist[icmp6->icmp6_type]++;
454 icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_msg);
455 if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK)
456 icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_error);
457
458 switch (icmp6->icmp6_type) {
459 case ICMP6_DST_UNREACH:

--- 2408 unchanged lines hidden ---