Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/ip_input.c,v retrieving revision 1.296 retrieving revision 1.296.2.1 diff -u -p -r1.296 -r1.296.2.1 --- src/sys/netinet/ip_input.c 2011/08/31 18:31:03 1.296 +++ src/sys/netinet/ip_input.c 2012/04/17 00:08:40 1.296.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.296 2011/08/31 18:31:03 plunky Exp $ */ +/* $NetBSD: ip_input.c,v 1.296.2.1 2012/04/17 00:08:40 yamt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.296 2011/08/31 18:31:03 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.296.2.1 2012/04/17 00:08:40 yamt Exp $"); #include "opt_inet.h" #include "opt_compat_netbsd.h" @@ -140,11 +140,6 @@ __KERNEL_RCSID(0, "$NetBSD: ip_input.c,v #include #endif -#ifdef IPSEC -#include -#include -#include -#endif #ifdef FAST_IPSEC #include #include @@ -456,7 +451,7 @@ ip_input(struct mbuf *m) goto bad; } if (hlen > m->m_len) { - if ((m = m_pullup(m, hlen)) == 0) { + if ((m = m_pullup(m, hlen)) == NULL) { IP_STATINC(IP_STAT_BADHLEN); return; } @@ -536,16 +531,11 @@ ip_input(struct mbuf *m) m_adj(m, len - m->m_pkthdr.len); } -#if defined(IPSEC) - /* ipflow (IP fast forwarding) is not compatible with IPsec. */ - m->m_flags &= ~M_CANFASTFWD; -#else /* * Assume that we can create a fast-forward IP flow entry * based on this packet. */ m->m_flags |= M_CANFASTFWD; -#endif #ifdef PFIL_HOOKS /* @@ -559,9 +549,7 @@ ip_input(struct mbuf *m) * let ipfilter look at packet on the wire, * not the decapsulated packet. */ -#ifdef IPSEC - if (!ipsec_getnhist(m)) -#elif defined(FAST_IPSEC) +#if defined(FAST_IPSEC) if (!ipsec_indone(m)) #else if (1) @@ -743,12 +731,6 @@ ip_input(struct mbuf *m) IP_STATINC(IP_STAT_CANTFORWARD); return; } -#ifdef IPSEC - if (ipsec4_in_reject(m, NULL)) { - IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); - goto bad; - } -#endif #ifdef FAST_IPSEC mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL); s = splsoftnet(); @@ -826,18 +808,6 @@ ours: hlen = ip->ip_hl << 2; } -#if defined(IPSEC) - /* - * enforce IPsec policy checking if we are seeing last header. - * note that we do not visit this with protocols with pcb layer - * code - like udp/tcp/raw ip. - */ - if ((inetsw[ip_protox[ip->ip_p]].pr_flags & PR_LASTHDR) != 0 && - ipsec4_in_reject(m, NULL)) { - IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); - goto bad; - } -#endif #ifdef FAST_IPSEC /* * enforce IPsec policy checking if we are seeing last header. @@ -1452,7 +1422,7 @@ ip_forward(struct mbuf *m, int srcrt) if ((rt = rtcache_validate(&ipforward_rt)) != NULL) destmtu = rt->rt_ifp->if_mtu; -#if defined(IPSEC) || defined(FAST_IPSEC) +#if defined(FAST_IPSEC) { /* * If the packet is routed over IPsec tunnel, tell the @@ -1494,14 +1464,10 @@ ip_forward(struct mbuf *m, int srcrt) } } -#ifdef IPSEC - key_freesp(sp); -#else KEY_FREESP(&sp); -#endif } } -#endif /*defined(IPSEC) || defined(FAST_IPSEC)*/ +#endif /*defined(FAST_IPSEC)*/ IP_STATINC(IP_STAT_CANTFRAG); break;