FreeBSD only reports a policy's usetime if a lifetime has been specified when the...
authorTobias Brunner <tobias@strongswan.org>
Tue, 4 Aug 2009 09:03:39 +0000 (11:03 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 4 Aug 2009 09:08:58 +0000 (11:08 +0200)
src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c

index ce34f19..a06c68e 100644 (file)
@@ -1888,6 +1888,13 @@ static status_t query_policy(private_kernel_pfkey_ipsec_t *this,
                free(out);
                return FAILED;
        }
+       else if (response.lft_current == NULL)
+       {
+               DBG1(DBG_KNL, "unable to query policy %R === %R %N: kernel reports no "
+                        "use time", src_ts, dst_ts, policy_dir_names, direction);
+               free(out);
+               return FAILED;
+       }
        
        *use_time = response.lft_current->sadb_lifetime_usetime;