diff options
| author | VANHULLEBUS Yvan <vanhu@FreeBSD.org> | 2009-06-12 15:44:35 +0000 |
|---|---|---|
| committer | VANHULLEBUS Yvan <vanhu@FreeBSD.org> | 2009-06-12 15:44:35 +0000 |
| commit | 7b495c449475e00df3f60227247279883d891bcf (patch) | |
| tree | e75e977677e2ddd8c5e3a47752c3693ea92b15e3 /sys/netipsec/ipsec_input.c | |
| parent | 84056e4e85f9a42d58738298001917dc22155a63 (diff) | |
Notes
Diffstat (limited to 'sys/netipsec/ipsec_input.c')
| -rw-r--r-- | sys/netipsec/ipsec_input.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c index ce6b06080691..4ec169bfe46b 100644 --- a/sys/netipsec/ipsec_input.c +++ b/sys/netipsec/ipsec_input.c @@ -121,6 +121,9 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) struct secasvar *sav; u_int32_t spi; int error; +#ifdef IPSEC_NAT_T + struct m_tag *tag; +#endif IPSEC_ISTAT(sproto, V_espstat.esps_input, V_ahstat.ahs_input, V_ipcompstat.ipcomps_input); @@ -175,6 +178,12 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) m_copydata(m, offsetof(struct ip, ip_dst), sizeof(struct in_addr), (caddr_t) &dst_address.sin.sin_addr); +#ifdef IPSEC_NAT_T + /* Find the source port for NAT-T; see udp*_espdecap. */ + tag = m_tag_find(m, PACKET_TAG_IPSEC_NAT_T_PORTS, NULL); + if (tag != NULL) + dst_address.sin.sin_port = ((u_int16_t *)(tag + 1))[1]; +#endif /* IPSEC_NAT_T */ break; #endif /* INET */ #ifdef INET6 |
