From patchwork Wed Jan 28 09:07:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ZORES X-Patchwork-Id: 20580 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 6B59EDDFFF for ; Wed, 28 Jan 2009 20:29:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752704AbZA1J3A (ORCPT ); Wed, 28 Jan 2009 04:29:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752401AbZA1J27 (ORCPT ); Wed, 28 Jan 2009 04:28:59 -0500 Received: from smail4.alcatel.fr ([62.23.212.167]:48164 "EHLO smail4.alcatel.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbZA1J27 (ORCPT ); Wed, 28 Jan 2009 04:28:59 -0500 X-Greylist: delayed 1168 seconds by postgrey-1.27 at vger.kernel.org; Wed, 28 Jan 2009 04:28:58 EST Received: from bsf.alcatel.fr (mail205.sxb.bsf.alcatel.fr [155.132.205.115]) by smail4.alcatel.fr (ALCANET/NETFR) with ESMTP id n0S99NE9011607 for ; Wed, 28 Jan 2009 10:09:23 +0100 Received: from mail (mail-bsf-alcatel-fr.sxb.bsf.alcatel.fr [155.132.205.91]) by bsf.alcatel.fr (8.8.8p2+Sun/8.9.3) with ESMTP id KAA20300 for ; Wed, 28 Jan 2009 10:09:23 +0100 (MET) Received: from [172.25.51.190] (frilld0f09516 [172.25.51.190]) by mail (8.8.8p2+Sun/) with ESMTP id KAA20295 for ; Wed, 28 Jan 2009 10:09:23 +0100 (MET) Message-ID: <49802060.5040709@alcatel-lucent.fr> Date: Wed, 28 Jan 2009 10:07:44 +0100 From: Benjamin ZORES User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) MIME-Version: 1.0 To: netdev@vger.kernel.org Subject: [PATCH] Fix infinite retry loop in IP-Config X-Alcanet-MTA-scanned-and-authorized: yes Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, The attached patch fixes some bug with ip-config max retry number. In ip_auto_config(), kernel tries to retrieve IP configuration forever in case of NFS root and some specific amount of time otherwise. The problem is that, in case of error, the code jump to the try_try_again goto statement, that reassigns the retry number counter, which obviously leads to an infinite loop if IP config fails. The attached patch corrects this behavior. Hope one can push it to mainstream kernel tree. Ben diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 42a0f3d..4911b81 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1268,6 +1268,7 @@ __be32 __init root_nfs_parse_addr(char *name) static int __init ip_auto_config(void) { __be32 addr; + int retries = CONF_OPEN_RETRIES; #ifdef CONFIG_PROC_FS proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops); @@ -1305,8 +1306,6 @@ static int __init ip_auto_config(void) ic_first_dev->next) { #ifdef IPCONFIG_DYNAMIC - int retries = CONF_OPEN_RETRIES; - if (ic_dynamic() < 0) { ic_close_devs();