Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757141Ab3C3Rbu (ORCPT ); Sat, 30 Mar 2013 13:31:50 -0400 Received: from latitanza.investici.org ([82.94.249.234]:44244 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756916Ab3C3Rbt (ORCPT ); Sat, 30 Mar 2013 13:31:49 -0400 X-Greylist: delayed 1317 seconds by postgrey-1.27 at vger.kernel.org; Sat, 30 Mar 2013 13:31:49 EDT X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org EA341980B1 From: Antonio Quartulli To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Fengguang Wu , Antonio Quartulli , Pravin B Shelar , "David S. Miller" Subject: [PATCH] ip_gre: don't overwrite iflink during net_dev init Date: Sat, 30 Mar 2013 18:07:37 +0100 Message-Id: <1364663257-14717-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <20130330115245.GA4024@ritirata.org> References: <20130330115245.GA4024@ritirata.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 49 iflink is currently set to 0 in __gre_tunnel_init(). This function is invoked in gre_tap_init() and ipgre_tunnel_init() which are both used to initialise the ndo_init field of the respective net_device_ops structs (ipgre.. and gre_tap..) used by GRE interfaces. However, in netdevice_register() iflink is first set to -1, then ndo_init is invoked and then iflink is assigned to a proper value if and only if it still was -1. Assigning 0 to iflink in ndo_init is therefore first preventing netdev_register() to correctly assign it a proper value and then breaking iflink at all since 0 has not correct meaning. Fix this by removing the iflink assignment in __gre_tunnel_init(). Introduced by c54419321455631079c7d6e60bc732dd0c5914c5 ("GRE: Refactor GRE tunneling code.") Reported-by: Fengguang Wu Cc: Pravin B Shelar Cc: "David S. Miller" Signed-off-by: Antonio Quartulli --- net/ipv4/ip_gre.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index ad662e9..e5dfd28 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -660,7 +660,6 @@ static void __gre_tunnel_init(struct net_device *dev) dev->needed_headroom = LL_MAX_HEADER + sizeof(struct iphdr) + 4; dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr) - 4; - dev->iflink = 0; dev->features |= NETIF_F_NETNS_LOCAL | GRE_FEATURES; dev->hw_features |= GRE_FEATURES; -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/