| version 1.236, 2006/11/16 01:33:45 |
version 1.236.2.2, 2008/03/30 15:27:49 |
|
|
| /* XXX error stat??? */ |
/* XXX error stat??? */ |
| error = EINVAL; |
error = EINVAL; |
| DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ |
DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ |
| goto bad; |
|
| } |
} |
| splx(s); |
splx(s); |
| if (error) |
if (error) |
| Line 1977 ip_forward(struct mbuf *m, int srcrt) |
|
| Line 1976 ip_forward(struct mbuf *m, int srcrt) |
|
| case EMSGSIZE: |
case EMSGSIZE: |
| type = ICMP_UNREACH; |
type = ICMP_UNREACH; |
| code = ICMP_UNREACH_NEEDFRAG; |
code = ICMP_UNREACH_NEEDFRAG; |
| #if !defined(IPSEC) && !defined(FAST_IPSEC) |
|
| if (ipforward_rt.ro_rt) |
|
| destmtu = ipforward_rt.ro_rt->rt_ifp->if_mtu; |
|
| #else |
|
| /* |
|
| * If the packet is routed over IPsec tunnel, tell the |
|
| * originator the tunnel MTU. |
|
| * tunnel MTU = if MTU - sizeof(IP) - ESP/AH hdrsiz |
|
| * XXX quickhack!!! |
|
| */ |
|
| if (ipforward_rt.ro_rt) { |
if (ipforward_rt.ro_rt) { |
| |
|
| |
#if defined(IPSEC) || defined(FAST_IPSEC) |
| |
/* |
| |
* If the packet is routed over IPsec tunnel, tell the |
| |
* originator the tunnel MTU. |
| |
* tunnel MTU = if MTU - sizeof(IP) - ESP/AH hdrsiz |
| |
* XXX quickhack!!! |
| |
*/ |
| |
|
| struct secpolicy *sp; |
struct secpolicy *sp; |
| int ipsecerror; |
int ipsecerror; |
| size_t ipsechdr; |
size_t ipsechdr; |
| Line 1996 ip_forward(struct mbuf *m, int srcrt) |
|
| Line 1995 ip_forward(struct mbuf *m, int srcrt) |
|
| sp = ipsec4_getpolicybyaddr(mcopy, |
sp = ipsec4_getpolicybyaddr(mcopy, |
| IPSEC_DIR_OUTBOUND, IP_FORWARDING, |
IPSEC_DIR_OUTBOUND, IP_FORWARDING, |
| &ipsecerror); |
&ipsecerror); |
| |
#endif |
| |
|
| if (sp == NULL) |
destmtu = ipforward_rt.ro_rt->rt_ifp->if_mtu; |
| destmtu = ipforward_rt.ro_rt->rt_ifp->if_mtu; |
#if defined(IPSEC) || defined(FAST_IPSEC) |
| else { |
if (sp != NULL) { |
| /* count IPsec header size */ |
/* count IPsec header size */ |
| ipsechdr = ipsec4_hdrsiz(mcopy, |
ipsechdr = ipsec4_hdrsiz(mcopy, |
| IPSEC_DIR_OUTBOUND, NULL); |
IPSEC_DIR_OUTBOUND, NULL); |
| Line 2028 ip_forward(struct mbuf *m, int srcrt) |
|
| Line 2028 ip_forward(struct mbuf *m, int srcrt) |
|
| KEY_FREESP(&sp); |
KEY_FREESP(&sp); |
| #endif |
#endif |
| } |
} |
| |
#endif /*defined(IPSEC) || defined(FAST_IPSEC)*/ |
| } |
} |
| #endif /*IPSEC*/ |
|
| ipstat.ips_cantfrag++; |
ipstat.ips_cantfrag++; |
| break; |
break; |
| |
|