netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Willi <martin@strongswan.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH] xfrm: Accept ESP packets regardless of UDP encapsulation  mode
Date: Thu, 04 Dec 2008 14:18:50 +0100	[thread overview]
Message-ID: <1228396731.1643.57.camel@martin> (raw)

An IPsec node speaking IKEv2 MUST accept incoming UDP encapsulated
ESP packets, even if no NAT situation is detected. This is important
if MOBIKE is in use. Some implementation keep the encapsulation
mode if they move out of a NAT situation.

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index b4a1317..65bcf09 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -167,11 +167,6 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 			goto drop_unlock;
 		}
 
-		if ((x->encap ? x->encap->encap_type : 0) != encap_type) {
-			XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEMISMATCH);
-			goto drop_unlock;
-		}
-
 		if (x->props.replay_window && xfrm_replay_check(x, skb, seq)) {
 			XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR);
 			goto drop_unlock;
-- 
1.5.6.3




             reply	other threads:[~2008-12-04 13:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 13:18 Martin Willi [this message]
2008-12-04 23:40 ` [PATCH] xfrm: Accept ESP packets regardless of UDP encapsulation mode David Miller
2008-12-18  3:47 ` Herbert Xu
2008-12-18  3:49   ` David Miller
2008-12-18  3:57     ` Herbert Xu
2008-12-18  4:14       ` Herbert Xu
2008-12-18  4:17         ` David Miller
2008-12-18  4:21           ` Herbert Xu
2008-12-18 10:35         ` Martin Willi
2008-12-18 11:04           ` Herbert Xu
2008-12-18 12:36             ` Martin Willi
2008-12-18 20:54               ` Herbert Xu
2008-12-19  3:23                 ` David Miller
2008-12-19 10:00                   ` Martin Willi
2008-12-19 10:19                     ` Herbert Xu
2008-12-18 22:38             ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1228396731.1643.57.camel@martin \
    --to=martin@strongswan.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).