From patchwork Thu Dec 4 13:18:50 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Willi X-Patchwork-Id: 12232 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id A5166DDDF6 for ; Fri, 5 Dec 2008 00:19:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753551AbYLDNTU (ORCPT ); Thu, 4 Dec 2008 08:19:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753202AbYLDNTU (ORCPT ); Thu, 4 Dec 2008 08:19:20 -0500 Received: from ns.km23152-01.keymachine.de ([87.118.114.125]:34971 "EHLO km23152-01.keymachine.de" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752196AbYLDNTT (ORCPT ); Thu, 4 Dec 2008 08:19:19 -0500 Received: from localhost (km23152-01.keymachine.de [127.0.0.1]) by km23152-01.keymachine.de (Postfix) with SMTP id CC9E32F18142 for ; Thu, 4 Dec 2008 11:18:56 +0100 (CET) Received: from [152.96.15.212] (unknown [152.96.15.212]) by km23152-01.keymachine.de (Postfix) with ESMTP id 3C84C2F180BC; Thu, 4 Dec 2008 11:18:55 +0100 (CET) Subject: [PATCH] xfrm: Accept ESP packets regardless of UDP encapsulation mode From: Martin Willi To: David Miller Cc: netdev@vger.kernel.org Date: Thu, 04 Dec 2008 14:18:50 +0100 Message-Id: <1228396731.1643.57.camel@martin> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Thu Dec 4 11:18:56 2008 X-DSPAM-Confidence: 0.9985 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4937ae90178822030574449 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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;