diff options
author | ae <ae@FreeBSD.org> | 2016-04-24 09:02:17 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2016-04-24 09:02:17 +0000 |
commit | dcf50398ab66cfcba0ae4484efe3b5ce40fb9824 (patch) | |
tree | d456d61d87136ae276d6e3fcba9582c7a643cc03 /sys/netipsec/key.h | |
parent | 3b2a510b4d4d97a58df91d2297ce08cdae4115f2 (diff) | |
download | FreeBSD-src-dcf50398ab66cfcba0ae4484efe3b5ce40fb9824.zip FreeBSD-src-dcf50398ab66cfcba0ae4484efe3b5ce40fb9824.tar.gz |
Handle non-compressed packets for IPComp in tunnel mode.
RFC3173 says that the IP datagram MUST be sent in the original
non-compressed form, when the total size of a compressed payload
and the IPComp header is not smaller than the size of the original
payload. In tunnel mode for small packets IPComp will send
encapsulated IP datagrams without IPComp header.
Add ip_encap handler for IPPROTO_IPV4 and IPPROTO_IPV6 to handle
these datagrams. The handler does lookup for SA related to IPComp
protocol and given from mbuf source and destination addresses as
tunnel endpoints. It decapsulates packets only when corresponding SA
is found.
Reported by: gnn
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D6062
Diffstat (limited to 'sys/netipsec/key.h')
-rw-r--r-- | sys/netipsec/key.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netipsec/key.h b/sys/netipsec/key.h index 82811be..ad2b53d 100644 --- a/sys/netipsec/key.h +++ b/sys/netipsec/key.h @@ -76,11 +76,15 @@ extern void _key_freesp(struct secpolicy **, const char*, int); extern struct secasvar *key_allocsa(union sockaddr_union *, u_int, u_int32_t, const char*, int); +extern struct secasvar *key_allocsa_tunnel(union sockaddr_union *, + union sockaddr_union *, u_int, const char*, int); extern void key_addrefsa(struct secasvar *, const char*, int); extern void key_freesav(struct secasvar **, const char*, int); #define KEY_ALLOCSA(dst, proto, spi) \ key_allocsa(dst, proto, spi, __FILE__, __LINE__) +#define KEY_ALLOCSA_TUNNEL(src, dst, proto) \ + key_allocsa_tunnel(src, dst, proto, __FILE__, __LINE__) #define KEY_ADDREFSA(sav) \ key_addrefsa(sav, __FILE__, __LINE__) #define KEY_FREESAV(psav) \ |