Re: [PATCH] Fix hard_use for xfrm_state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



   From: Herbert Xu <herbert@gondor.apana.org.au>
   Date: Sun, 1 Jun 2003 09:59:54 +1000

   As it stands, unless a state is used within a second of its
   creation, it may never get expired via hard_use_expire_seconds.
   
What this code is trying to do is determine the earliest time
at which it would next need to check that one of the following
lifetime variables have expired:

1) hard_add_expires_seconds
2) hard_use_expires_seconds
3) soft_add_expires_seconds
4) soft_use_expires_seconds

It computes the minimum of all such timeouts and then uses this to
reschedule the timer (or timeout/expire/rekey the xfrm_state).

Both soft and hard use expirations need to do something in this area.
So at a minimum, your patch needs to be extended to fix the bug for
the soft case as well.  It currently only fixes the hard case.

But, when "x->curlft.use_time" is zero, we should compute 'tmo'
as "x->lft.{soft,hard}_use_expires_seconds - now".  This means
that it should be sufficient to just remove "&& x->curlft.use_time"
from the two if statements.

This works because the earliest it could be first used is "now".
Eventually, in your version of the fix, "now" could catch up to
"add_time" and thus have the same failure you're trying to eliminate
:-)
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux