From patchwork Wed Mar 13 12:37:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 227266 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 567BA2C009D for ; Wed, 13 Mar 2013 23:37:48 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933083Ab3CMMh1 (ORCPT ); Wed, 13 Mar 2013 08:37:27 -0400 Received: from mail-ea0-f175.google.com ([209.85.215.175]:62065 "EHLO mail-ea0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932074Ab3CMMhY (ORCPT ); Wed, 13 Mar 2013 08:37:24 -0400 Received: by mail-ea0-f175.google.com with SMTP id o10so391694eaj.6 for ; Wed, 13 Mar 2013 05:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:content-transfer-encoding; bh=aSvE2ZHWk+8SCNT4twtXjjW6Cfj+tgb12XBB6oD0ndE=; b=qHZqnD3gxiXOsQsNIoqVvu7c/pEu4T+u4DZ04RUaoT3ExmJR2ohaYBOlU0jxt1ClXa TAMntrO6amZH5O/5aGkXkPVnwbq8dS7SQDUR+HLVALT4uqyF8gEW8H386EX6H28namgI f3dMmYgIH5YYLr49TFDd47M3ftflym3s64IGTpPNIyn4cGR3yyQJhMVCej4Fzx3pmBEo bw8xiokmqM6gmDz25V0bYOZBeQo3ToKmXVRhegnLnD2Dk7IAjeUvihY6R5OoGFrGslvv d7f8Wn0HdwvwSqDRdJbiITr89iSPRqZtTcc7DCKUjx8jIoybQnGVHEh6mmT3fXjh3LMZ RzIw== X-Received: by 10.15.45.201 with SMTP id b49mr59313785eew.9.1363178241683; Wed, 13 Mar 2013 05:37:21 -0700 (PDT) Received: from vostro.util.wtbts.net ([83.145.235.199]) by mx.google.com with ESMTPS id ca4sm32105534eeb.15.2013.03.13.05.37.19 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Mar 2013 05:37:20 -0700 (PDT) From: =?UTF-8?q?Timo=20Ter=C3=A4s?= To: netdev@vger.kernel.org, Isaku Yamahata , Eric Dumazet , "David S. Miller" Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= Subject: [PATCH] Revert "ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally" Date: Wed, 13 Mar 2013 14:37:49 +0200 Message-Id: <1363178269-27553-1-git-send-email-timo.teras@iki.fi> X-Mailer: git-send-email 1.8.1.5 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This reverts commit 412ed94744d16806fbec3bd250fd94e71cde5a1f. The commit is wrong as tiph points to the outer IPv4 header which is installed at ipgre_header() and not the inner one which is protocol dependant. This commit broke succesfully opennhrp which use PF_PACKET socket with ETH_P_NHRP protocol. Additionally ssl_addr is set to the link-layer IPv4 address. This address is written by ipgre_header() to the skb earlier, and this is the IPv4 header tiph should point to - regardless of the inner protocol payload. Signed-off-by: Timo Teräs --- net/ipv4/ip_gre.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) This commit appeared in 3.8.x. So should go to 3.8.x-stable. diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index d0ef0e6..91d66db 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -798,10 +798,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev if (dev->header_ops && dev->type == ARPHRD_IPGRE) { gre_hlen = 0; - if (skb->protocol == htons(ETH_P_IP)) - tiph = (const struct iphdr *)skb->data; - else - tiph = &tunnel->parms.iph; + tiph = (const struct iphdr *)skb->data; } else { gre_hlen = tunnel->hlen; tiph = &tunnel->parms.iph;