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

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

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 */
31
32#include <sys/cdefs.h>
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

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

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 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/netinet/ip_input.c 207369 2010-04-29 11:52:42Z bz $");
33__FBSDID("$FreeBSD: head/sys/netinet/ip_input.c 211157 2010-08-11 00:51:50Z will $");
34
35#include "opt_bootp.h"
36#include "opt_ipfw.h"
37#include "opt_ipstealth.h"
38#include "opt_ipsec.h"
39#include "opt_route.h"
34
35#include "opt_bootp.h"
36#include "opt_ipfw.h"
37#include "opt_ipstealth.h"
38#include "opt_ipsec.h"
39#include "opt_route.h"
40#include "opt_carp.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/callout.h>
45#include <sys/mbuf.h>
46#include <sys/malloc.h>
47#include <sys/domain.h>
48#include <sys/protosw.h>

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

69#include <netinet/in_var.h>
70#include <netinet/ip.h>
71#include <netinet/in_pcb.h>
72#include <netinet/ip_var.h>
73#include <netinet/ip_fw.h>
74#include <netinet/ip_icmp.h>
75#include <netinet/ip_options.h>
76#include <machine/in_cksum.h>
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/callout.h>
44#include <sys/mbuf.h>
45#include <sys/malloc.h>
46#include <sys/domain.h>
47#include <sys/protosw.h>

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

68#include <netinet/in_var.h>
69#include <netinet/ip.h>
70#include <netinet/in_pcb.h>
71#include <netinet/ip_var.h>
72#include <netinet/ip_fw.h>
73#include <netinet/ip_icmp.h>
74#include <netinet/ip_options.h>
75#include <machine/in_cksum.h>
77#ifdef DEV_CARP
78#include <netinet/ip_carp.h>
76#include <netinet/ip_carp.h>
79#endif
80#ifdef IPSEC
81#include <netinet/ip_ipsec.h>
82#endif /* IPSEC */
83
84#include <sys/socketvar.h>
85
86#include <security/mac/mac_framework.h>
87

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

601 * the packets are received.
602 *
603 * XXX - This is the case for carp vhost IPs as well so we
604 * insert a workaround. If the packet got here, we already
605 * checked with carp_iamatch() and carp_forus().
606 */
607 checkif = V_ip_checkinterface && (V_ipforwarding == 0) &&
608 ifp != NULL && ((ifp->if_flags & IFF_LOOPBACK) == 0) &&
77#ifdef IPSEC
78#include <netinet/ip_ipsec.h>
79#endif /* IPSEC */
80
81#include <sys/socketvar.h>
82
83#include <security/mac/mac_framework.h>
84

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

598 * the packets are received.
599 *
600 * XXX - This is the case for carp vhost IPs as well so we
601 * insert a workaround. If the packet got here, we already
602 * checked with carp_iamatch() and carp_forus().
603 */
604 checkif = V_ip_checkinterface && (V_ipforwarding == 0) &&
605 ifp != NULL && ((ifp->if_flags & IFF_LOOPBACK) == 0) &&
609#ifdef DEV_CARP
610 !ifp->if_carp &&
611#endif
612 (dchg == 0);
606 ifp->if_carp == NULL && (dchg == 0);
613
614 /*
615 * Check for exact addresses in the hash bucket.
616 */
617 /* IN_IFADDR_RLOCK(); */
618 LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) {
619 /*
620 * If the address matches, verify that the packet

--- 1182 unchanged lines hidden ---
607
608 /*
609 * Check for exact addresses in the hash bucket.
610 */
611 /* IN_IFADDR_RLOCK(); */
612 LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) {
613 /*
614 * If the address matches, verify that the packet

--- 1182 unchanged lines hidden ---