Deleted Added
full compact
ip_input.c (141064) ip_input.c (142215)
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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * @(#)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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94
30 * $FreeBSD: head/sys/netinet/ip_input.c 141064 2005-01-30 19:29:47Z rwatson $
30 * $FreeBSD: head/sys/netinet/ip_input.c 142215 2005-02-22 13:04:05Z glebius $
31 */
32
33#include "opt_bootp.h"
34#include "opt_ipfw.h"
35#include "opt_ipstealth.h"
36#include "opt_ipsec.h"
37#include "opt_mac.h"
31 */
32
33#include "opt_bootp.h"
34#include "opt_ipfw.h"
35#include "opt_ipstealth.h"
36#include "opt_ipsec.h"
37#include "opt_mac.h"
38#include "opt_carp.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/callout.h>
42#include <sys/mac.h>
43#include <sys/mbuf.h>
44#include <sys/malloc.h>
45#include <sys/domain.h>

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

61#include <netinet/in.h>
62#include <netinet/in_systm.h>
63#include <netinet/in_var.h>
64#include <netinet/ip.h>
65#include <netinet/in_pcb.h>
66#include <netinet/ip_var.h>
67#include <netinet/ip_icmp.h>
68#include <machine/in_cksum.h>
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/callout.h>
43#include <sys/mac.h>
44#include <sys/mbuf.h>
45#include <sys/malloc.h>
46#include <sys/domain.h>

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

62#include <netinet/in.h>
63#include <netinet/in_systm.h>
64#include <netinet/in_var.h>
65#include <netinet/ip.h>
66#include <netinet/in_pcb.h>
67#include <netinet/ip_var.h>
68#include <netinet/ip_icmp.h>
69#include <machine/in_cksum.h>
70#ifdef DEV_CARP
71#include <netinet/ip_carp.h>
72#endif
69
70#include <sys/socketvar.h>
71
72/* XXX: Temporary until ipfw_ether and ipfw_bridge are converted. */
73#include <netinet/ip_fw.h>
74#include <netinet/ip_dummynet.h>
75
76#ifdef IPSEC

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

504 * 'ipfw fwd'.
505 *
506 * XXX - Checking also should be disabled if the destination
507 * address is ipnat'ed to a different interface.
508 *
509 * XXX - Checking is incompatible with IP aliases added
510 * to the loopback interface instead of the interface where
511 * the packets are received.
73
74#include <sys/socketvar.h>
75
76/* XXX: Temporary until ipfw_ether and ipfw_bridge are converted. */
77#include <netinet/ip_fw.h>
78#include <netinet/ip_dummynet.h>
79
80#ifdef IPSEC

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

508 * 'ipfw fwd'.
509 *
510 * XXX - Checking also should be disabled if the destination
511 * address is ipnat'ed to a different interface.
512 *
513 * XXX - Checking is incompatible with IP aliases added
514 * to the loopback interface instead of the interface where
515 * the packets are received.
516 *
517 * XXX - This is the case for carp vhost IPs as well so we
518 * insert a workaround. If the packet got here, we already
519 * checked with carp_iamatch() and carp_forus().
512 */
513 checkif = ip_checkinterface && (ipforwarding == 0) &&
514 m->m_pkthdr.rcvif != NULL &&
515 ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) &&
520 */
521 checkif = ip_checkinterface && (ipforwarding == 0) &&
522 m->m_pkthdr.rcvif != NULL &&
523 ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) &&
524#ifdef DEV_CARP
525 !m->m_pkthdr.rcvif->if_carp &&
526#endif
516 (dchg == 0);
517
518 /*
519 * Check for exact addresses in the hash bucket.
520 */
521 LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) {
522 /*
523 * If the address matches, verify that the packet

--- 1600 unchanged lines hidden ---
527 (dchg == 0);
528
529 /*
530 * Check for exact addresses in the hash bucket.
531 */
532 LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) {
533 /*
534 * If the address matches, verify that the packet

--- 1600 unchanged lines hidden ---