| version 1.296, 2011/08/31 18:31:03 |
version 1.297, 2011/12/19 11:59:56 |
| Line 140 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| Line 140 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| #include <netinet/ip_mroute.h> |
#include <netinet/ip_mroute.h> |
| #endif |
#endif |
| |
|
| #ifdef IPSEC |
#ifdef KAME_IPSEC |
| #include <netinet6/ipsec.h> |
#include <netinet6/ipsec.h> |
| #include <netinet6/ipsec_private.h> |
#include <netinet6/ipsec_private.h> |
| #include <netkey/key.h> |
#include <netkey/key.h> |
| Line 536 ip_input(struct mbuf *m) |
|
| Line 536 ip_input(struct mbuf *m) |
|
| m_adj(m, len - m->m_pkthdr.len); |
m_adj(m, len - m->m_pkthdr.len); |
| } |
} |
| |
|
| #if defined(IPSEC) |
#if defined(KAME_IPSEC) |
| /* ipflow (IP fast forwarding) is not compatible with IPsec. */ |
/* ipflow (IP fast forwarding) is not compatible with IPsec. */ |
| m->m_flags &= ~M_CANFASTFWD; |
m->m_flags &= ~M_CANFASTFWD; |
| #else |
#else |
| Line 559 ip_input(struct mbuf *m) |
|
| Line 559 ip_input(struct mbuf *m) |
|
| * let ipfilter look at packet on the wire, |
* let ipfilter look at packet on the wire, |
| * not the decapsulated packet. |
* not the decapsulated packet. |
| */ |
*/ |
| #ifdef IPSEC |
#ifdef KAME_IPSEC |
| if (!ipsec_getnhist(m)) |
if (!ipsec_getnhist(m)) |
| #elif defined(FAST_IPSEC) |
#elif defined(FAST_IPSEC) |
| if (!ipsec_indone(m)) |
if (!ipsec_indone(m)) |
| Line 743 ip_input(struct mbuf *m) |
|
| Line 743 ip_input(struct mbuf *m) |
|
| IP_STATINC(IP_STAT_CANTFORWARD); |
IP_STATINC(IP_STAT_CANTFORWARD); |
| return; |
return; |
| } |
} |
| #ifdef IPSEC |
#ifdef KAME_IPSEC |
| if (ipsec4_in_reject(m, NULL)) { |
if (ipsec4_in_reject(m, NULL)) { |
| IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
| goto bad; |
goto bad; |
|
|
| hlen = ip->ip_hl << 2; |
hlen = ip->ip_hl << 2; |
| } |
} |
| |
|
| #if defined(IPSEC) |
#if defined(KAME_IPSEC) |
| /* |
/* |
| * enforce IPsec policy checking if we are seeing last header. |
* enforce IPsec policy checking if we are seeing last header. |
| * note that we do not visit this with protocols with pcb layer |
* note that we do not visit this with protocols with pcb layer |
| Line 1452 ip_forward(struct mbuf *m, int srcrt) |
|
| Line 1452 ip_forward(struct mbuf *m, int srcrt) |
|
| if ((rt = rtcache_validate(&ipforward_rt)) != NULL) |
if ((rt = rtcache_validate(&ipforward_rt)) != NULL) |
| destmtu = rt->rt_ifp->if_mtu; |
destmtu = rt->rt_ifp->if_mtu; |
| |
|
| #if defined(IPSEC) || defined(FAST_IPSEC) |
#if defined(KAME_IPSEC) || defined(FAST_IPSEC) |
| { |
{ |
| /* |
/* |
| * If the packet is routed over IPsec tunnel, tell the |
* If the packet is routed over IPsec tunnel, tell the |
| Line 1494 ip_forward(struct mbuf *m, int srcrt) |
|
| Line 1494 ip_forward(struct mbuf *m, int srcrt) |
|
| } |
} |
| } |
} |
| |
|
| #ifdef IPSEC |
#ifdef KAME_IPSEC |
| key_freesp(sp); |
key_freesp(sp); |
| #else |
#else |
| KEY_FREESP(&sp); |
KEY_FREESP(&sp); |
| #endif |
#endif |
| } |
} |
| } |
} |
| #endif /*defined(IPSEC) || defined(FAST_IPSEC)*/ |
#endif /*defined(KAME_IPSEC) || defined(FAST_IPSEC)*/ |
| IP_STATINC(IP_STAT_CANTFRAG); |
IP_STATINC(IP_STAT_CANTFRAG); |
| break; |
break; |
| |
|