From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754700AbXFLOJ3 (ORCPT ); Tue, 12 Jun 2007 10:09:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751832AbXFLOJU (ORCPT ); Tue, 12 Jun 2007 10:09:20 -0400 Received: from stinky.trash.net ([213.144.137.162]:37019 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450AbXFLOJS (ORCPT ); Tue, 12 Jun 2007 10:09:18 -0400 Message-ID: <466EA861.2070509@trash.net> Date: Tue, 12 Jun 2007 16:06:25 +0200 From: Patrick McHardy User-Agent: Debian Thunderbird 1.0.7 (X11/20051019) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Neukum CC: linux-kernel@vger.kernel.org, Linux Netdev List , Herbert Xu Subject: Re: cannot set IP for ethernet References: <200706121441.13561.oliver@neukum.org> In-Reply-To: <200706121441.13561.oliver@neukum.org> X-Enigmail-Version: 0.93.0.0 Content-Type: multipart/mixed; boundary="------------020208040209090108060507" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------020208040209090108060507 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Oliver Neukum wrote: > with 2.6.22-rc4-git2 I am getting errors when setting IP for ethernet > interfaces: > > ioctl(4, SIOCSIFADDR, 0x7fff94931600) = -1 ENOBUFS (No buffer space available) > > The error is independant of the interface. It happens to all interfaces. > There's nothing in the syslog. > > valisk:/home/oliver # uname -a > Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux This can happen if the initial inetdev allocation when the netdevice is registered fails. I think it would make sense to try to allocate again when adding addresses in that case, otherwise there is no way of recovery other than unregistering and registering the device again. --------------020208040209090108060507 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index abf6352..dc77e91 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -401,8 +401,11 @@ static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa) ASSERT_RTNL(); if (!in_dev) { - inet_free_ifa(ifa); - return -ENOBUFS; + in_dev = inetdev_init(dev); + if (!in_dev) { + inet_free_ifa(ifa); + return -ENOBUFS; + } } ipv4_devconf_setall(in_dev); if (ifa->ifa_dev != in_dev) { @@ -514,8 +517,11 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh) in_dev = __in_dev_get_rtnl(dev); if (in_dev == NULL) { - err = -ENOBUFS; - goto errout; + in_dev = inetdev_init(dev); + if (!in_dev) { + err = -ENOBUFS; + goto errout; + } } ipv4_devconf_setall(in_dev); --------------020208040209090108060507--