Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 76846

Summary: ifconfig module: infinite loop when bringing down interfaces on uclibc system
Product: Gentoo Linux Reporter: SpanKY <vapier>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: embedded
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 66472    

Description SpanKY gentoo-dev 2005-01-05 20:11:12 UTC
this bug is about net.modules.d/ifconfig:ifconfig_del_addresses()

the ifconfig module rips off ip addresses by running `ifconfig ${iface} 0` ... on a glibc system, the 0 is extended properly to all 4 bytes, but on uclibc systems, our inet_aton() func is a little cheap (cheap is good, means it's smaller :D), and doesnt handle the semi-undocumented 'extend this address' feature.  what this means is that any address not in the 'a.b.c.d' form is considered invalid :(.

on my uclibc system, this caused `reboot` to get stuck in a loop:
<snip>
0: Unknown host
ifconfig: `--help' gives usage information.
0: Unknown host
ifconfig: `--help' gives usage information.
0: Unknown host
ifconfig: `--help' gives usage information.
0: Unknown host
ifconfig: `--help' gives usage information.
0: Unknown host
ifconfig: `--help' gives usage information.
<snip>

running `ifconfig ${iface} 0.0.0.0` works for both glibc and uclibc systems

getting back to this loop ... recoding it like this will protect against future errors (whatever they be), and will save pointless forks:
-  while ifconfig ${iface} | grep -q -m1 -o 'inet addr:[^ ]*' ; do
+  local addrcnt=$(ifconfig eth3 | grep -c -o 'inet addr:[^ ]*')
+  while ((addrcnt--)) ; do
Comment 1 solar (RETIRED) gentoo-dev 2005-01-06 09:58:27 UTC
Why eth3 ?
Comment 2 SpanKY gentoo-dev 2005-01-06 10:35:07 UTC
a typo, should be ${iface}

eth3 was the interface i was testing with on my machine
Comment 3 Roy Marples (RETIRED) gentoo-dev 2005-01-06 13:53:47 UTC
We can't use that loop as ifconfig does not report all addresses added by iproute2 - and we need to erase them all.

However, the ifconfig ${iface} 0.0.0.0 code is fine :)

Fixed in CVS - will be in baselayout-1.11.9
Comment 4 Roy Marples (RETIRED) gentoo-dev 2005-01-31 00:01:59 UTC
Fixed by baselayout-1.11.9