| version 1.82.2.2.4.2, 1999/07/06 11:02:46 |
version 1.82.2.2.4.3, 1999/11/30 13:35:31 |
|
|
| |
|
| #include "opt_gateway.h" |
#include "opt_gateway.h" |
| #include "opt_pfil_hooks.h" |
#include "opt_pfil_hooks.h" |
| |
#include "opt_ipsec.h" |
| #include "opt_mrouting.h" |
#include "opt_mrouting.h" |
| |
|
| #include <sys/param.h> |
#include <sys/param.h> |
|
|
| |
|
| #ifdef IPSEC |
#ifdef IPSEC |
| #include <netinet6/ipsec.h> |
#include <netinet6/ipsec.h> |
| #include <netinet6/ah.h> |
|
| #ifdef IPSEC_ESP |
|
| #include <netinet6/esp.h> |
|
| #endif |
|
| #include <netkey/key.h> |
#include <netkey/key.h> |
| #include <netkey/key_debug.h> |
#include <netkey/key_debug.h> |
| #endif |
#endif |
| Line 196 int ipprintfs = 0; |
|
| Line 193 int ipprintfs = 0; |
|
| |
|
| struct rttimer_queue *ip_mtudisc_timeout_q = NULL; |
struct rttimer_queue *ip_mtudisc_timeout_q = NULL; |
| |
|
| |
#ifdef ALTQ |
| |
int (*altq_input) __P((struct mbuf *, int)) = NULL; |
| |
#endif |
| |
|
| extern struct domain inetdomain; |
extern struct domain inetdomain; |
| extern struct protosw inetsw[]; |
extern struct protosw inetsw[]; |
| u_char ip_protox[IPPROTO_MAX]; |
u_char ip_protox[IPPROTO_MAX]; |
| Line 405 ip_input(struct mbuf *m) |
|
| Line 406 ip_input(struct mbuf *m) |
|
| goto bad; |
goto bad; |
| } |
} |
| |
|
| |
#ifdef ALTQ |
| |
if (altq_input != NULL && (*altq_input)(m, AF_INET) == 0) |
| |
/* packet is dropped by traffic conditioner */ |
| |
return; |
| |
#endif |
| /* |
/* |
| * Convert fields to host representation. |
* Convert fields to host representation. |
| */ |
*/ |
| Line 439 ip_input(struct mbuf *m) |
|
| Line 445 ip_input(struct mbuf *m) |
|
| m_adj(m, len - m->m_pkthdr.len); |
m_adj(m, len - m->m_pkthdr.len); |
| } |
} |
| |
|
| |
#ifdef IPSEC |
| |
/* ipflow (IP fast fowarding) is not compatible with IPsec. */ |
| |
m->m_flags &= ~M_CANFASTFWD; |
| |
#else |
| /* |
/* |
| * Assume that we can create a fast-forward IP flow entry |
* Assume that we can create a fast-forward IP flow entry |
| * based on this packet. |
* based on this packet. |
| */ |
*/ |
| m->m_flags |= M_CANFASTFWD; |
m->m_flags |= M_CANFASTFWD; |
| |
#endif |
| |
|
| #ifdef PFIL_HOOKS |
#ifdef PFIL_HOOKS |
| /* |
/* |
| Line 1425 ip_forward(m, srcrt) |
|
| Line 1436 ip_forward(m, srcrt) |
|
| struct route *ro; |
struct route *ro; |
| |
|
| sp = ipsec4_getpolicybyaddr(mcopy, |
sp = ipsec4_getpolicybyaddr(mcopy, |
| IP_FORWARDING, |
IPSEC_DIR_OUTBOUND, |
| &ipsecerror); |
IP_FORWARDING, |
| |
&ipsecerror); |
| |
|
| if (sp == NULL) |
if (sp == NULL) |
| destifp = ipforward_rt.ro_rt->rt_ifp; |
destifp = ipforward_rt.ro_rt->rt_ifp; |
| else { |
else { |
| /* count IPsec header size */ |
/* count IPsec header size */ |
| ipsechdr = ipsec4_hdrsiz(mcopy, NULL); |
ipsechdr = ipsec4_hdrsiz(mcopy, |
| |
IPSEC_DIR_OUTBOUND, |
| |
NULL); |
| |
|
| /* |
/* |
| * find the correct route for outer IPv4 |
* find the correct route for outer IPv4 |
| Line 1445 ip_forward(m, srcrt) |
|
| Line 1459 ip_forward(m, srcrt) |
|
| /*XXX*/ |
/*XXX*/ |
| destifp = NULL; |
destifp = NULL; |
| if (sp->req != NULL |
if (sp->req != NULL |
| && sp->req->sa != NULL) { |
&& sp->req->sav != NULL |
| ro = &sp->req->sa->saidx->sa_route; |
&& sp->req->sav->sah != NULL) { |
| |
ro = &sp->req->sav->sah->sa_route; |
| if (ro->ro_rt && ro->ro_rt->rt_ifp) { |
if (ro->ro_rt && ro->ro_rt->rt_ifp) { |
| dummyifp.if_mtu = |
dummyifp.if_mtu = |
| ro->ro_rt->rt_ifp->if_mtu; |
ro->ro_rt->rt_ifp->if_mtu; |