NetBSD/sys/netkey
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
..
key_debug.c Change about 4500 of the K&R function definitions to ANSI ones. 2009-03-14 15:35:58 +00:00
key_debug.h Remove all the __P() from sys (excluding sys/dist) 2009-03-14 14:45:51 +00:00
key_private.h Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
key_var.h
key.c fix two bugs in the PFKEY interface: 2010-09-05 06:52:53 +00:00
key.h Remove all the __P() from sys (excluding sys/dist) 2009-03-14 14:45:51 +00:00
keydb.c Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
keydb.h Remove all the __P() from sys (excluding sys/dist) 2009-03-14 14:45:51 +00:00
keysock.c Replace splsoftnet() with proper mutexes as suggested by ad@. 2009-05-09 11:36:17 +00:00
keysock.h Remove all the __P() from sys (excluding sys/dist) 2009-03-14 14:45:51 +00:00
Makefile