Cache the most recent reqid in the PF_KEY kernel interface.
authorTobias Brunner <tobias@strongswan.org>
Tue, 10 May 2011 12:00:03 +0000 (14:00 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 6 Jul 2011 07:43:45 +0000 (09:43 +0200)
This makes the PF_KEY kernel interface behave the same as the Netlink
kernel interface.

src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c

index 75336f2..3958ca8 100644 (file)
@@ -1618,8 +1618,9 @@ METHOD(kernel_ipsec_t, add_policy, status_t,
        if (this->policies->find_first(this->policies,
                        (linked_list_match_t)policy_entry_equals, (void**)&found, policy) == SUCCESS)
        {
-               /* use existing policy */
+               /* use existing policy, but cache the most recent reqid */
                found->refcount++;
+               found->reqid = policy->reqid;
                DBG2(DBG_KNL, "policy %R === %R %N already exists, increasing "
                                          "refcount", src_ts, dst_ts,
                                           policy_dir_names, direction);