user ifconfig call initiates loading of ax.25 modules

Jonathan Nieder jrnieder at gmail.com
Wed Jul 4 15:16:38 UTC 2012


severity 680204 important
reassign 680204 net-tools 1.60-24.1
# still present in commit e8b37a84 (2012-06-29) from
# git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools
tags 680204 + upstream
quit

Hi,

sergio wrote:

> I'm not sure, may be this is the ifconfig (net-tools) bug, but
> when I do ifconfig as user (or with -a) someones loads netrom and rose
> modules
[...]
> % ifconfig
> <skipped>
> % lsmod| grep -E \(rose\|netrom\|ax25\)
> rose                   37586  0 
> netrom                 32996  0 
> ax25                   46974  2 rose,netrom

Yes, I can reproduce this.  It's due to this code in lib/util.c:

	int kernel_version(void)
	{
	    struct utsname uts;
	    int major, minor, patch;

	    if (uname(&uts) < 0)
		return -1;
	    if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
		return -1;
	    return KRELEASE(major, minor, patch);
	}

A two-component version number is perfectly normal, but this code
doesn't recognize know that and kernel_version() == -1.  As a result,
the logic

	if (kernel_version() < KRELEASE(2, 1, 0))
	    force = 1;

in lib/sockets.c triggers, producing the bug.

Hope that helps,
Jonathan



More information about the Pkg-net-tools-maintainers mailing list