diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-07-30 14:04:17 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-07-30 14:06:26 +0200 |
commit | eab05274f479cb1ab477b640666e1acd17580621 (patch) | |
tree | 46c40d559eaac9bd8d8d38eae78431f7d3d6a650 /src/charon | |
parent | e20bd8b6ea31951402c01baff32ddf86261c4e3a (diff) | |
download | strongswan-eab05274f479cb1ab477b640666e1acd17580621.tar.bz2 strongswan-eab05274f479cb1ab477b640666e1acd17580621.tar.xz |
Handling of unsupported policy directions (FWD) fixed.
Diffstat (limited to 'src/charon')
-rw-r--r-- | src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c b/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c index e2ad766ad..f4003e4b8 100644 --- a/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c +++ b/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c @@ -478,7 +478,7 @@ static u_int8_t dir2kernel(policy_dir_t dir) return IPSEC_DIR_FWD; #endif default: - return dir; + return IPSEC_DIR_INVALID; } } @@ -1558,6 +1558,12 @@ static status_t add_policy(private_kernel_pfkey_ipsec_t *this, pfkey_msg_t response; size_t len; + if (dir2kernel(direction) == IPSEC_DIR_INVALID) + { + /* FWD policies are not supported on all platforms */ + return SUCCESS; + } + /* create a policy */ policy = create_policy_entry(src_ts, dst_ts, direction, reqid); @@ -1740,6 +1746,12 @@ static status_t query_policy(private_kernel_pfkey_ipsec_t *this, pfkey_msg_t response; size_t len; + if (dir2kernel(direction) == IPSEC_DIR_INVALID) + { + /* FWD policies are not supported on all platforms */ + return NOT_FOUND; + } + DBG2(DBG_KNL, "querying policy %R === %R %N", src_ts, dst_ts, policy_dir_names, direction); @@ -1827,6 +1839,12 @@ static status_t del_policy(private_kernel_pfkey_ipsec_t *this, route_entry_t *route; size_t len; + if (dir2kernel(direction) == IPSEC_DIR_INVALID) + { + /* FWD policies are not supported on all platforms */ + return SUCCESS; + } + DBG2(DBG_KNL, "deleting policy %R === %R %N", src_ts, dst_ts, policy_dir_names, direction); |