cannot set IP for ethernet
Subsystems (3)
Hi,
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
Regards
Oliver
Quoted 5 lines · Oliver Neukum
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)
And if you do it over netlink, as is common today?
Jan
Quoted 10 lines · Oliver Neukum
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 2007x86_64x86_64x86_64GNU/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.
net/ipv4/devinet.c +10 -4
@@ -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);
Am Dienstag, 12. Juni 2007 schrieb Jan Engelhardt:
Quoted 9 lines · Oliver Neukum
Quoted 5 lines
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)And if you do it over netlink, as is common today?
valisk:/home/oliver # strace ip addr add 192.168.234.17/24 brd + dev eth1execve("/sbin/ip", ["ip", "addr", "add", "192.168.234.17/24", "brd", "+", "dev", "eth1"], [/* 84 vars */]) = 0
brk(0) = 0x628000mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b18e11de000 uname({sys="Linux", node="valisk", ...}) = 0access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)open("/etc/ld.so.cache", O_RDONLY) = 3fstat(3, {st_mode=S_IFREG|0644, st_size=160918, ...}) = 0mmap(NULL, 160918, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b18e11df000
close(3) = 0open("/lib64/libresolv.so.2", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P5\0\0\0"..., 832) = 832fstat(3, {st_mode=S_IFREG|0755, st_size=73920, ...}) = 0mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b18e1207000 mmap(NULL, 2177896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b18e13e0000 fadvise64(3, 0, 2177896, POSIX_FADV_WILLNEED) = 0mprotect(0x2b18e13f1000, 2093056, PROT_NONE) = 0
mmap(0x2b18e15f0000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x2b18e15f0000 mmap(0x2b18e15f2000, 7016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b18e15f2000
close(3) = 0open("/lib64/libc.so.6", O_RDONLY) = 3read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\332\1\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1358528, ...}) = 0mmap(NULL, 3404024, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b18e15f4000 fadvise64(3, 0, 3404024, POSIX_FADV_WILLNEED) = 0mprotect(0x2b18e172b000, 2093056, PROT_NONE) = 0
mmap(0x2b18e192a000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x136000) = 0x2b18e192a000 mmap(0x2b18e192f000, 16632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b18e192f000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b18e1934000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b18e1935000
arch_prctl(ARCH_SET_FS, 0x2b18e1934b00) = 0mprotect(0x2b18e192a000, 12288, PROT_READ) = 0munmap(0x2b18e11df000, 160918) = 0socket(PF_NETLINK, SOCK_RAW, 0) = 3setsockopt(3, SOL_SOCKET, SO_SNDBUF, [32768], 4) = 0setsockopt(3, SOL_SOCKET, SO_RCVBUF, [32768], 4) = 0bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0getsockname(3, {sa_family=AF_NETLINK, pid=12240, groups=00000000}, [16230387979418337292]) = 0gettimeofday({1181657227, 120512}, NULL) = 0
sendto(3, "\24\0\0\0\22\0\1\3\214\250nF\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\370\0\0\0\20\0\2\0\214\250nF\320/\0\0\0\0\4\3\1\0\0\0"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 1004
brk(0) = 0x628000
brk(0x649000) = 0x649000
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\214\250nF\320/\0\0\0\0\0\0\1\0\0\0I\0"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 20 sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\5\0\215\250nF\0\0\0\0\2\30\0\0\2\0\0\0\10"..., 48}], msg_controllen=0, msg_flags=0}, 0) = 48 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"$\0\0\0\2\0\0\0\215\250nF\320/\0\0\227\377\377\3770\0\0"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 36
dup(2) = 4fcntl(4, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)fstat(4, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...}) = 0mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b18e11df000lseek(4, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(4, "RTNETLINK answers: No buffer spa"..., 45RTNETLINK answers: No buffer space available
) = 45
close(4) = 0 munmap(0x2b18e11df000, 4096) = 0 exit_group(2) = ?
Process 12240 detached
No luck, but it was not repeatable, as "ifconfig" was.
Regards
Oliver
Quoted 6 lines · Oliver Neukum
Quoted 6 lines · Oliver Neukum
Quoted 5 lines
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)
Do you run VPN or some sort?
Jan
Quoted 11 lines · Jan Engelhardt
Quoted 6 lines · Oliver Neukum
Quoted 6 lines · Oliver Neukum
Quoted 5 lines
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)Do you run VPN or some sort?
As far as I can see only inet_device allocation failure can lead to this error. Please try the patch I sent in case it is reproducable after reboot.
Am Dienstag, 12. Juni 2007 schrieb Jan Engelhardt:
Quoted 10 lines · Oliver Neukum
Quoted 6 lines
Quoted 6 lines · Oliver Neukum
Quoted 5 lines
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)Do you run VPN or some sort?
Yes, racoon, but the connection was down when I tried setting the IP.
Regards
Oliver
Am Dienstag, 12. Juni 2007 schrieb Patrick McHardy:
Quoted 9 lines
Quoted 8 lines · Oliver Neukum
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.
Quoted 8 lines
Quoted 2 lines
valisk:/home/oliver # uname -a
Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007x86_64x86_64x86_64GNU/LinuxThis 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.
With your patch the problem has gone away. Is there a way to especially stress the system in that regard?
Regards
Oliver
Quoted 16 lines · Oliver Neukum
Am Dienstag, 12. Juni 2007 schrieb Patrick McHardy:
Quoted 14 lines
Quoted 10 lines · Oliver Neukum
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 2007x86_64x86_64x86_64GNU/Linux
Quoted 8 lines
Quoted 4 lines
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.
With your patch the problem has gone away. Is there a way to especially stress the system in that regard?
Its a failed allocation at NETDEV_REGISTER time. I guess you could keep unloading + reloading the driver module to try to reproduce it.
Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
Quoted 23 lines
Quoted 22 lines · Oliver Neukum
Am Dienstag, 12. Juni 2007 schrieb Patrick McHardy:
Quoted 18 lines
Quoted 10 lines · Oliver Neukum
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 2007x86_64x86_64x86_64GNU/LinuxThis 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.
Quoted 6 lines
Quoted 2 lines
With your patch the problem has gone away. Is there a way to especially stress the system in that regard?
Its a failed allocation at
NETDEV_REGISTERtime. I guess you could keep unloading + reloading the driver module to try to reproduce it.
If that is the cause, why doesn't it strike from the very beginning? How come it fails after some time?
Regards
Oliver
Quoted 12 lines · Oliver Neukum
Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
Quoted 11 lines
Quoted 9 lines
Quoted 5 lines
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.
With your patch the problem has gone away. Is there a way to especially stress the system in that regard?
Quoted 6 lines
Quoted 2 lines
Its a failed allocation at
NETDEV_REGISTERtime. I guess you could keep unloading + reloading the driver module to try to reproduce it.If that is the cause, why doesn't it strike from the very beginning? How come it fails after some time?
It might also be a failed in_ifaddr allocation. In that case my patch shouldn't help though.
Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
Quoted 17 lines
Quoted 16 lines · Oliver Neukum
Am Mittwoch, 13. Juni 2007 schrieb Patrick McHardy:
Quoted 13 lines
Quoted 9 lines
Quoted 5 lines
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.
With your patch the problem has gone away. Is there a way to especially stress the system in that regard?
Its a failed allocation at
NETDEV_REGISTERtime. I guess you could keep unloading + reloading the driver module to try to reproduce it.
Quoted 6 lines
Quoted 2 lines
If that is the cause, why doesn't it strike from the very beginning? How come it fails after some time?
It might also be a failed
in_ifaddrallocation. In that case my patch shouldn't help though.
The problem is that I don't know how to provoke the failure. I might be doing another workload today than yesterday. Perhaps I should do several compilations like yesterday?
Regards
Oliver
Quoted 9 lines · Patrick McHardy
Quoted 8 lines · Oliver Neukum
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.
Quoted 7 lines
Quoted 2 lines
valisk:/home/oliver # uname -a
Linux valisk 2.6.22-rc4-git2-default #3 SMP Tue Jun 12 13:27:54 CEST 2007x86_64x86_64x86_64GNU/LinuxThis 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.
Actually in his case it's because 2.6.22-rc4-git2 doesn't have the following changeset.
Let me have a think about your approach too.
Thanks,
Signature · 18 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
commit 6363097cc4d182f93788131b5d8f72aa91d950a0
Author: Herbert Xu <[email protected]>
Date: Thu Jun 7 18:35:38 2007 -0700
[IPV4]: Do not remove idev when addresses are cleared
Now that we create idev before addresses are added, it no longer makes
sense to remove them when addresses are all deleted.
Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
6363097cc4d182f93788131b5d8f72aa91d950a0net/ipv4/devinet.c +1 -5
@@ -327,12 +327,8 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap, } } -if (destroy) { +if (destroy)inet_free_ifa (ifa1); - -if (!in_dev->ifa_list) -inetdev_destroy (in_dev); - } } static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
David Miller
maintainerFrom: Herbert Xu <[email protected]>
Date: Thu, 14 Jun 2007 13:53:41 +1000
Quoted 2 lines
Actually in his case it's because 2.6.22-rc4-git2 doesn't have the following changeset.
It's on the way, it just hasn't been picked up yet.