NetBSD/sys/netipsec
spz 445e6acd20 fix two bugs in the PFKEY interface:
1) RFC2367 says in 2.3.3 Address Extension: "All non-address
   information in the sockaddrs, such as sin_zero for AF_INET sockaddrs,
   and sin6_flowinfo for AF_INET6 sockaddrs, MUST be zeroed out."
   the IPSEC_NAT_T code was expecting the port information it needs
   to be conveyed in the sockaddr instead of exclusively by
   SADB_X_EXT_NAT_T_SPORT and SADB_X_EXT_NAT_T_DPORT,
   and was not zeroing out the port information in the non-nat-traversal
   case.
   Since it was expecting the port information to reside in the sockaddr
   it could get away with (re)setting the ports after starting to use them.
   -> Set the natt ports before setting the SA mature.

2) RFC3947 has two Original Address fields, initiator and responder,
   so we need SADB_X_EXT_NAT_T_OAI and SADB_X_EXT_NAT_T_OAR and not just
   SADB_X_EXT_NAT_T_OA

The change has been created using vanhu's patch for FreeBSD as reference.

Note that establishing actual nat-t sessions has not yet been tested.

Likely fixes the following:
PR bin/41757
PR net/42592
PR net/42606
2010-09-05 06:52:53 +00:00
..
ah_var.h Make IPSEC and FAST_IPSEC stats per-cpu. Use <net/net_stats.h> and 2008-04-23 06:09:04 +00:00
ah.h
esp_var.h Make IPSEC and FAST_IPSEC stats per-cpu. Use <net/net_stats.h> and 2008-04-23 06:09:04 +00:00
esp.h
files.netipsec defflag IPSEC_DEBUG 2007-11-16 21:15:20 +00:00
ipcomp_var.h Make IPSEC and FAST_IPSEC stats per-cpu. Use <net/net_stats.h> and 2008-04-23 06:09:04 +00:00
ipcomp.h
ipip_var.h Make IPSEC and FAST_IPSEC stats per-cpu. Use <net/net_stats.h> and 2008-04-23 06:09:04 +00:00
ipsec6.h Adapt FAST_IPSEC to recent KPI changes. 2009-05-10 02:13:07 +00:00
ipsec_input.c Remove extra whitespace added by a stupid tool. 2009-04-18 14:58:02 +00:00
ipsec_mbuf.c Make IPSEC and FAST_IPSEC stats per-cpu. Use <net/net_stats.h> and 2008-04-23 06:09:04 +00:00
ipsec_netbsd.c Simplify the interface to netstat_sysctl() and allocate space for 2008-05-04 07:22:14 +00:00
ipsec_osdep.h Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants, 2008-01-20 18:09:03 +00:00
ipsec_output.c Cosmetic: fix indentation, change some spaces to tabs. 2009-12-01 01:01:34 +00:00
ipsec_private.h Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ipsec_var.h Make IPSEC and FAST_IPSEC stats per-cpu. Use <net/net_stats.h> and 2008-04-23 06:09:04 +00:00
ipsec.c Further silence ipsec_attach(). 2010-07-21 20:41:31 +00:00
ipsec.h Adapt FAST_IPSEC to recent KPI changes. 2009-05-10 02:13:07 +00:00
key_debug.c Ansify 2007-07-07 18:38:22 +00:00
key_debug.h Ansify 2007-07-07 18:38:22 +00:00
key_var.h
key.c fix two bugs in the PFKEY interface: 2010-09-05 06:52:53 +00:00
key.h Ansify 2007-07-07 18:38:22 +00:00
keydb.h trivial comment typo 2010-08-28 07:16:51 +00:00
keysock.c Remove separate mb_map. The nmbclusters is computed at boot time based 2010-02-08 19:02:25 +00:00
keysock.h PF_KEY stats for IPSEC and FAST_IPSEC are now per-CPU. 2008-04-23 07:29:47 +00:00
Makefile
xform_ah.c Remove extra whitespace added by a stupid tool. 2009-04-18 14:58:02 +00:00
xform_esp.c Correct bungled bcopy() -> memcpy() conversion 2009-03-20 05:26:37 +00:00
xform_ipcomp.c bzero -> memset 2009-03-18 16:00:08 +00:00
xform_ipip.c Fix some fallout from socket locking patch : 2008-04-27 12:58:48 +00:00
xform_tcp.c bzero -> memset 2009-03-18 16:00:08 +00:00
xform.h