diff mbox

xfrm: check if packet is overdue on asynchronous code path

Message ID 1357891965-8047-1-git-send-email-roy.qing.li@gmail.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Li RongQing Jan. 11, 2013, 8:12 a.m. UTC
From: Li RongQing <roy.qing.li@gmail.com>

Currently checking is only done on synchronous code path,
we should do the same checking on asynchronous code path.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/xfrm/xfrm_input.c |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Steffen Klassert Jan. 11, 2013, 8:29 a.m. UTC | #1
On Fri, Jan 11, 2013 at 04:12:45PM +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
> 
> Currently checking is only done on synchronous code path,
> we should do the same checking on asynchronous code path.

We do this check already before we enter the asynchronous code path,
there is no need to do this check again.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index ab2bb42..d034324 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -199,6 +199,12 @@  int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 
 resume:
 		spin_lock(&x->lock);
+
+		if (async && xfrm_state_check_expire(x)) {
+			XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEEXPIRED);
+			goto drop_unlock;
+		}
+
 		if (nexthdr <= 0) {
 			if (nexthdr == -EBADMSG) {
 				xfrm_audit_state_icvfail(x, skb,