Hide Forgot
ifconfig (and other components of net-tools) check the uname return to figure out if they should grovel /proc or just try opening sockets. Unfortunately with 3.0 version numbers, they fall back to a pre v2.1 behaviour, which results in autoloading a pile of crappy socket types (an entirely different bug.) Prevent this by parsing both two and 3 digit Linux version numbers. Patch attached. (strace of the behaviour) uname({sys="Linux", node="dreadnought.i.jkkm.org", ...}) = 0 access("/proc/net", R_OK) = 0 socket(PF_FILE, SOCK_DGRAM, 0) = 3 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 5 socket(PF_AX25, SOCK_DGRAM, 0) = -1 EAFNOSUPPORT (Address family not supported by protocol) socket(PF_NETROM, SOCK_SEQPACKET, 0) = -1 EAFNOSUPPORT (Address family not supported by protocol) socket(PF_ROSE, SOCK_DGRAM, 0) = -1 ESOCKTNOSUPPORT (Socket type not supported) socket(PF_IPX, SOCK_DGRAM, [PF_UNSPEC]) = 6 (normal strace) uname({sys="Linux", node="feynman.i.jkkm.org", ...}) = 0 access("/proc/net", R_OK) = 0 access("/proc/net/unix", R_OK) = 0 socket(PF_FILE, SOCK_DGRAM, 0) = 3 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 access("/proc/net/if_inet6", R_OK) = 0 socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 5 access("/proc/net/ax25", R_OK) = -1 ENOENT (No such file or directory)
Created attachment 511097 [details] test both 2 and 3
Thanks for the patch! Applied in net-tools-1.60-122.fc16.
Thanks very much, I'll update you when we know what the version number for 3.0 will finally be, we may be able to drop the patch. --Kyle
The uts.release string looks like '3.1.6-1.fc16.x86_64' on my machine, so the sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) returns 3. Does that mean we can eventually drop the patch ?
Yes, Linus changed his mind when he released 3.0. regards, Kyle