diff options
author | Martin Willi <martin@revosec.ch> | 2013-12-18 11:56:36 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-06-04 16:32:09 +0200 |
commit | 6aaa432741c6675493c7a07bc5e9c5ea69eaf21e (patch) | |
tree | 88e2204497eec4fdc86de713a7943d51d15afad3 /src/libcharon/plugins/kernel_wfp | |
parent | 288dc68596f6c5b52d061356e3599ba50087e355 (diff) | |
download | strongswan-6aaa432741c6675493c7a07bc5e9c5ea69eaf21e.tar.bz2 strongswan-6aaa432741c6675493c7a07bc5e9c5ea69eaf21e.tar.xz |
kernel-wfp: Add some missing IPv6 GUIDs, fix IPv6 host conversion
Diffstat (limited to 'src/libcharon/plugins/kernel_wfp')
-rw-r--r-- | src/libcharon/plugins/kernel_wfp/kernel_wfp_compat.c | 12 | ||||
-rw-r--r-- | src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c | 19 |
2 files changed, 29 insertions, 2 deletions
diff --git a/src/libcharon/plugins/kernel_wfp/kernel_wfp_compat.c b/src/libcharon/plugins/kernel_wfp/kernel_wfp_compat.c index 05659399d..2be369159 100644 --- a/src/libcharon/plugins/kernel_wfp/kernel_wfp_compat.c +++ b/src/libcharon/plugins/kernel_wfp/kernel_wfp_compat.c @@ -33,15 +33,27 @@ const GUID FWPM_CONDITION_IP_PROTOCOL = { const GUID FWPM_LAYER_INBOUND_TRANSPORT_V4 = { 0x5926dfc8, 0xe3cf, 0x4426, { 0xa2,0x83,0xdc,0x39,0x3f,0x5d,0x0f,0x9d } }; +const GUID FWPM_LAYER_INBOUND_TRANSPORT_V6 = { + 0x634a869f, 0xfc23, 0x4b90, { 0xb0,0xc1,0xbf,0x62,0x0a,0x36,0xae,0x6f } +}; const GUID FWPM_LAYER_OUTBOUND_TRANSPORT_V4 = { 0x09e61aea, 0xd214, 0x46e2, { 0x9b,0x21,0xb2,0x6b,0x0b,0x2f,0x28,0xc8 } }; +const GUID FWPM_LAYER_OUTBOUND_TRANSPORT_V6 = { + 0xe1735bde, 0x013f, 0x4655, { 0xb3,0x51,0xa4,0x9e,0x15,0x76,0x2d,0xf0 } +}; const GUID FWPM_CALLOUT_IPSEC_INBOUND_TRANSPORT_V4 = { 0x5132900d, 0x5e84, 0x4b5f, { 0x80,0xe4,0x01,0x74,0x1e,0x81,0xff,0x10 } }; +const GUID FWPM_CALLOUT_IPSEC_INBOUND_TRANSPORT_V6 = { + 0x49d3ac92, 0x2a6c, 0x4dcf, { 0x95,0x5f,0x1c,0x3b,0xe0,0x09,0xdd,0x99 } +}; const GUID FWPM_CALLOUT_IPSEC_OUTBOUND_TRANSPORT_V4 = { 0x4b46bf0a, 0x4523, 0x4e57, { 0xaa,0x38,0xa8,0x79,0x87,0xc9,0x10,0xd9 } }; +const GUID FWPM_CALLOUT_IPSEC_OUTBOUND_TRANSPORT_V6 = { + 0x38d87722, 0xad83, 0x4f11, { 0xa9,0x1f,0xdf,0x0f,0xb0,0x77,0x22,0x5b } +}; /** * Load a function symbol from a loaded dll diff --git a/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c b/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c index 3dbbb30a6..a658fd150 100644 --- a/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c +++ b/src/libcharon/plugins/kernel_wfp/kernel_wfp_ipsec.c @@ -804,6 +804,21 @@ static bool install_sa(private_kernel_wfp_ipsec_t *this, entry_t *entry, } /** + * Convert an IPv6 host address to WFP representation + */ +static void host2address6(host_t *host, void *out) +{ + u_int32_t *src, *dst = out; + + src = (u_int32_t*)host->get_address(host).ptr; + + dst[0] = untoh32(&src[3]); + dst[1] = untoh32(&src[2]); + dst[2] = untoh32(&src[1]); + dst[3] = untoh32(&src[0]); +} + +/** * Fill in traffic structure from entry addresses */ static bool hosts2traffic(private_kernel_wfp_ipsec_t *this, @@ -822,8 +837,8 @@ static bool hosts2traffic(private_kernel_wfp_ipsec_t *this, return TRUE; case AF_INET6: traffic->ipVersion = FWP_IP_VERSION_V6; - memcpy(&traffic->localV6Address, l->get_address(l).ptr, 16); - memcpy(&traffic->remoteV6Address, r->get_address(r).ptr, 16); + host2address6(l, &traffic->localV6Address); + host2address6(r, &traffic->remoteV6Address); return TRUE; default: return FALSE; |