Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 85041 - /sbin/ifconfig lo up does not work
Summary: /sbin/ifconfig lo up does not work
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2005-03-12 23:00 UTC by John Bowler
Modified: 2005-03-15 08:04 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

output of "emerge info" (emerge-info.txt,3.31 KB, text/plain)
2005-03-13 06:55 UTC, John Bowler
Small shell script to test ifconfig/lo (,111 bytes, text/plain)
2005-03-13 08:20 UTC, John Bowler
Output of (>lo.txt 2>&1) on the problem computer (lo.txt,680 bytes, text/plain)
2005-03-13 08:22 UTC, John Bowler

Note You need to log in before you can comment on or make changes to this bug.
Description John Bowler 2005-03-12 23:00:24 UTC
This is on a very recently synced/updated 2.6.11-mm2, ifconfig reports "Don't know how to set addresses for family 2.", this seems reasonable - the inet address is hardwired to, however the line in question is used in /etc/init.d/net.lo start() (and I haven't edited it by hand, and I have a minimal system).

Removing the from /etc/init.d/net.lo fixes the problem.  (Removing the 2>/dev/null also helps, because there is no error checking, so why bitbucket the error?)

Don't know what changed, but it looks like ifconfig (I can't imagine that line wasn't actually tested - lo does not come up on the system.)

Reproducible: Always
Steps to Reproduce:
1. boot
2. ifconfig
3. observe: no lo

Actual Results:  
lo wasn't up

Expected Results:  
Brought up lo

Minimal system - genkernel, it's 2.6.11-mm2 and the root is reiser4, maybe mm 
has a patch to detect an attempt to set an inet on lo?
Comment 1 Elfyn McBratney (beu) (RETIRED) gentoo-dev 2005-03-13 00:05:44 UTC
what version of net-tools ?
Comment 2 SpanKY gentoo-dev 2005-03-13 00:08:43 UTC
you neglected to provide `emerge info` like the bug report page told you to
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2005-03-13 06:48:13 UTC
Try updating to 2.6.11-mm3 - if it worked previously to 2.6.11-mm2 update, I assume it is a kernel issue.
Comment 4 John Bowler 2005-03-13 06:55:15 UTC
Created attachment 53336 [details]
output of "emerge info"
Comment 5 John Bowler 2005-03-13 07:00:35 UTC
See attachment emerge-info.txt
The original bug was not submitted from this machine which was minimally configured, configuration has changed since then, however the behaviour of ifconfig still reproduces with the current configuration (elinks added, kde emerge started but build failed)
emerge --pretend net-tools outputs:
[ebuild R ] sys-apps/net-tools-1.60-r9
I can't see any other way of getting version information
Comment 6 John Bowler 2005-03-13 07:03:12 UTC
This *is* 2.6.11-mm3, but it also happened with 2.6.11-mm2
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2005-03-13 07:33:09 UTC
John, so you cannot really think of anything else that changed since it last worked?

Roy, mind having a look as you are our network scripts guru.
Comment 8 John Bowler 2005-03-13 07:55:58 UTC
The more I think about it the more I think it *never* worked.  The primary symptom is that ping <self> doesn't get any packets back, but when this *did* work my system did not have /sbin/ifconfig.  I bootstrapped as follows:
1) LiveCD minimal, 2005 rc5?  Follow stage1 instructions.  The network is fine (automatically, from DHCP).  Presumably it used ifconfig/scripts off LiveCD
2) Create reiserfs system, bootstrap into that (2.6.11-mm2), fine, but no /sbin/ifconfig, no /sbin/domainname (I emerged udhcpc).
3) From the new system re-bootstrap but now with a Reiser4 enabled kernel on a completely clean (new) partition.  Because of the missing ifconfig etc from rc5 I reverted to 2004.3.  Standard bootstrap: mkfs(reiser4), untar stage1, chroot (all exactly as in the instructions), reboot into the new, reiser4, partition.

And this is where the system is at (I'm in the process of emerging kde).  It *does* have an ifconfig, but the initscript ifconfig line doesn't work - so I changed it to work (remove and the pipe into devnull).

I did notice that genkernel/initrd brings up eth0, but not, apparently, lo and does not take it down - the net.lo re-runs (and fails), but net.eth0 does not run on the main bootstrap (yet eth0 is there).  Presumably busybox and a different script are being used (and that means a different ifconfig and for sure udhcpc, not dhcpcd).  I'm now using a non-initrd system.

Easy repro:
1) /sbin/ifconfig lo up
   This should fail with a meaningful error message (it doesn't matter if lo is already up).
2) /sbin/ifconfig lo up
   This should succeed (return status 0)
3) Examine /etc/init.d/net.lo
   It should contain the equivalent of (1) above, not (2)
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2005-03-13 08:06:24 UTC
nosferatu build-default-i686-pc-linux-gnu-nptl # ifconfig lo down
nosferatu build-default-i686-pc-linux-gnu-nptl # /sbin/ifconfig lo up
nosferatu build-default-i686-pc-linux-gnu-nptl # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:6E:C8:2F:86
          inet addr:  Bcast:  Mask:
          RX packets:330326 errors:0 dropped:0 overruns:0 frame:0
          TX packets:327486 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:75332050 (71.8 Mb)  TX bytes:28812897 (27.4 Mb)
          Base address:0xcf80 Memory:fe9e0000-fea00000

lo        Link encap:Local Loopback
          inet addr:  Mask:
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:15267 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4252356 (4.0 Mb)  TX bytes:4252356 (4.0 Mb)

nosferatu build-default-i686-pc-linux-gnu-nptl #

Comment 10 John Bowler 2005-03-13 08:20:30 UTC
Created attachment 53342 [details]
Small shell script to test ifconfig/lo

This script executes ifconfig with the option string which fails on my system
and checks the result
Comment 11 John Bowler 2005-03-13 08:22:44 UTC
Created attachment 53343 [details]
Output of (>lo.txt 2>&1) on the problem computer
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2005-03-13 10:02:17 UTC

nosferatu build-default-i686-pc-linux-gnu-nptl # ifconfig --version
net-tools 1.60
ifconfig 1.42 (2001-04-13)
nosferatu build-default-i686-pc-linux-gnu-nptl # epm -q net-tools
nosferatu build-default-i686-pc-linux-gnu-nptl #
Comment 13 Roy Marples (RETIRED) gentoo-dev 2005-03-13 10:57:18 UTC
Address family 2 is IPv4 - so if ifconfig cannot add family 2 addresses, how did you give eth0 an IPv4 address? DHCP? Are you able to give eth0 an IPv4 address using ifconfig?

Can you try iproute2?
emerge iproute2
ip addr add dev lo broadcast
ip link set lo up

If iproute2 works and ifconfig fails, try re-emerging net-tools.
If it still fails and iproute2 works then it's an ifconfig bug.
Comment 14 John Bowler 2005-03-13 11:24:53 UTC
ifconfig on eth0 fails with the same message.

$ip addr add dev lo broadcast
>> the 'broadcast' seems to need a parameter, but:
$ip addr add dev lo
>> reports:
>> RTNETLINK answers: File exists 
$ip link set lo up
>> this brings up lo, with the expected inet address
$ip addr add dev lo
>> this gives no message, however ifconfig shows that the inet
>> address of the loopback interface is still

ldd shows that both ifconfig and ip are pulling in, which, curiously, has no matching file.

emerge net-tools hangs after the compile of mii-tool.c, it's waiting for input from a configure script.

Typing a sufficient number of returns to that script completes the build, but ifconfig is still in the same state.

My conclusion is that 'emerge net-tools' is broken because of the configure script.  Presumably on my original system build the hang caused net-tools not to get installed at all and on my new system the config is somehow broken.
Comment 15 John Bowler 2005-03-13 11:30:37 UTC
emerge net-tools hangs at:

/bin/sh -c "if [ config.status -nt ]; then ./ config.status; else ./; fi

It executes the else clause.  It's in work/net-tools-1.60, exists, config.status does not.
Comment 16 John Bowler 2005-03-13 13:01:43 UTC
I added sys-apps/net-tools to package.keywords, redid the emerge net-tools, picking up r11.  This doesn't have the same problem - the ebuild completes without error or hang.

After doing this ifconfig lo up works correctly.

On reboot lo comes up fine with my still-hacked /etc/init.d/net.lo (i.e. ifconfig lo up still works ok and the loopback interface still has the correct inet address and netmask).
Comment 17 SpanKY gentoo-dev 2005-03-13 20:58:26 UTC
r11 marked stable
Comment 18 John Bowler 2005-03-15 08:04:50 UTC
That fixes it.