Deleted Added
full compact
ip_reass.c (83130) ip_reass.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_input.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_input.c 8.2 (Berkeley) 1/4/94
34 * $FreeBSD: head/sys/netinet/ip_input.c 83130 2001-09-06 02:40:43Z jlemon $
34 * $FreeBSD: head/sys/netinet/ip_input.c 83934 2001-09-25 18:40:52Z brooks $
35 */
36
37#define _IP_VHL
38
39#include "opt_bootp.h"
40#include "opt_ipfw.h"
41#include "opt_ipdn.h"
42#include "opt_ipdivert.h"

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

55#include <sys/socket.h>
56#include <sys/time.h>
57#include <sys/kernel.h>
58#include <sys/syslog.h>
59#include <sys/sysctl.h>
60
61#include <net/pfil.h>
62#include <net/if.h>
35 */
36
37#define _IP_VHL
38
39#include "opt_bootp.h"
40#include "opt_ipfw.h"
41#include "opt_ipdn.h"
42#include "opt_ipdivert.h"

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

55#include <sys/socket.h>
56#include <sys/time.h>
57#include <sys/kernel.h>
58#include <sys/syslog.h>
59#include <sys/sysctl.h>
60
61#include <net/pfil.h>
62#include <net/if.h>
63#include <net/if_types.h>
63#include <net/if_var.h>
64#include <net/if_dl.h>
65#include <net/route.h>
66#include <net/netisr.h>
67#include <net/intrq.h>
68
69#include <netinet/in.h>
70#include <netinet/in_systm.h>

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

79
80#include <netinet/ip_fw.h>
81
82#ifdef IPSEC
83#include <netinet6/ipsec.h>
84#include <netkey/key.h>
85#endif
86
64#include <net/if_var.h>
65#include <net/if_dl.h>
66#include <net/route.h>
67#include <net/netisr.h>
68#include <net/intrq.h>
69
70#include <netinet/in.h>
71#include <netinet/in_systm.h>

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

80
81#include <netinet/ip_fw.h>
82
83#ifdef IPSEC
84#include <netinet6/ipsec.h>
85#include <netkey/key.h>
86#endif
87
87#include "faith.h"
88#if defined(NFAITH) && NFAITH > 0
89#include <net/if_types.h>
90#endif
91
92#ifdef DUMMYNET
93#include <netinet/ip_dummynet.h>
94#endif
95
96int rsvp_on = 0;
97static int ip_rsvp_on;
98struct socket *ip_rsvpd;
99

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

552 * XXX - Checking also should be disabled if the destination
553 * address is ipnat'ed to a different interface.
554 *
555 * XXX - Checking is incompatible with IP aliases added
556 * to the loopback interface instead of the interface where
557 * the packets are received.
558 */
559 checkif = ip_checkinterface && (ipforwarding == 0) &&
88#ifdef DUMMYNET
89#include <netinet/ip_dummynet.h>
90#endif
91
92int rsvp_on = 0;
93static int ip_rsvp_on;
94struct socket *ip_rsvpd;
95

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

548 * XXX - Checking also should be disabled if the destination
549 * address is ipnat'ed to a different interface.
550 *
551 * XXX - Checking is incompatible with IP aliases added
552 * to the loopback interface instead of the interface where
553 * the packets are received.
554 */
555 checkif = ip_checkinterface && (ipforwarding == 0) &&
556 m->m_pkthdr.rcvif != NULL &&
560 ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) &&
561 (ip_fw_fwd_addr == NULL);
562
563 TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) {
564#define satosin(sa) ((struct sockaddr_in *)(sa))
565
566#ifdef BOOTP_COMPAT
567 if (IA_SIN(ia)->sin_addr.s_addr == INADDR_ANY)

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

629 }
630 goto ours;
631 }
632 if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST)
633 goto ours;
634 if (ip->ip_dst.s_addr == INADDR_ANY)
635 goto ours;
636
557 ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) &&
558 (ip_fw_fwd_addr == NULL);
559
560 TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) {
561#define satosin(sa) ((struct sockaddr_in *)(sa))
562
563#ifdef BOOTP_COMPAT
564 if (IA_SIN(ia)->sin_addr.s_addr == INADDR_ANY)

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

626 }
627 goto ours;
628 }
629 if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST)
630 goto ours;
631 if (ip->ip_dst.s_addr == INADDR_ANY)
632 goto ours;
633
637#if defined(NFAITH) && 0 < NFAITH
638 /*
639 * FAITH(Firewall Aided Internet Translator)
640 */
641 if (m->m_pkthdr.rcvif && m->m_pkthdr.rcvif->if_type == IFT_FAITH) {
642 if (ip_keepfaith) {
643 if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_ICMP)
644 goto ours;
645 }
646 m_freem(m);
647 return;
648 }
634 /*
635 * FAITH(Firewall Aided Internet Translator)
636 */
637 if (m->m_pkthdr.rcvif && m->m_pkthdr.rcvif->if_type == IFT_FAITH) {
638 if (ip_keepfaith) {
639 if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_ICMP)
640 goto ours;
641 }
642 m_freem(m);
643 return;
644 }
649#endif
645
650 /*
651 * Not for us; forward if possible and desirable.
652 */
653 if (ipforwarding == 0) {
654 ipstat.ips_cantforward++;
655 m_freem(m);
656 } else
657 ip_forward(m, 0);

--- 1249 unchanged lines hidden ---
646 /*
647 * Not for us; forward if possible and desirable.
648 */
649 if (ipforwarding == 0) {
650 ipstat.ips_cantforward++;
651 m_freem(m);
652 } else
653 ip_forward(m, 0);

--- 1249 unchanged lines hidden ---