dhclient without arguments removes IPv4 address from loopback

Bug #16473 reported by Karl Trygve Kalleberg
14
Affects Status Importance Assigned to Milestone
dhcp3 (Debian)
Fix Released
Unknown
dhcp3 (Ubuntu)
Fix Released
Medium
Scott James Remnant (Canonical)

Bug Description

Freshly booted system (kubuntu 5.04), no dhclient run in any boot scripts:

# ifconfig lo

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:77 errors:0 dropped:0 overruns:0 frame:0
          TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6049 (5.9 KiB) TX bytes:6049 (5.9 KiB)

Then, run dhclient without any arguments, to look for IP on all system's
interfaces (i.e., wireless and Ethernet in my case):

# dhclient

Internet Systems Consortium DHCP Client V3.0.1
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/sit0/
Sending on LPF/sit0/
Listening on LPF/eth0/00:0c:f1:0a:d3:f3
Sending on LPF/eth0/00:0c:f1:0a:d3:f3
Listening on LPF/lo/
Sending on LPF/lo/
Listening on LPF/eth1/00:0d:60:af:db:11
Sending on LPF/eth1/00:0d:60:af:db:11
Sending on Socket/fallback
DHCPDISCOVER on sit0 to 255.255.255.255 port 67 interval 4
DHCPREQUEST on eth1 to 255.255.255.255 port 67
DHCPACK from 131.211.80.9
bound to 131.211.80.125 -- renewal in 85282 seconds.

After which:

# ifconfig lo
lo Link encap:Local Loopback
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:78 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6377 (6.2 KiB) TX bytes:6377 (6.2 KiB)

and

# ifconfig sit0

sit0 Link encap:IPv6-in-IPv4
          inet6 addr: ::127.0.0.1/96 Scope:Unknown
          inet6 addr: ::131.211.80.125/96 Scope:Compat
          UP RUNNING NOARP MTU:1480 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:2 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

and

# ping 127.0.0.1

PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

Of course, the lack of an available 127.0.0.1 address, makes essential parts of
the system stop working. In particular, printing through cups is no longer
possible, nor is reaching the cups configuration daemon. For programs that fire
up a local webserver to offer "online" help, such as Eclipse, the help browsers
just hang, etc.

I fail to see the reason why dhclient should mess with lo in the first place.
It's rather unlikely that there will ever be any IP address handed out via DHCP
to that interface.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 15 Jun 2000 23:08:20 +0200
From: Uwe Storbeck <email address hidden>
To: <email address hidden>
Subject: dhclient-2.2.x tries to get a lease for the loopback interface

Package: dhcp-client
Version: 2.0-3

dhclient-2.2.x tries to get a lease for the loopback interface "lo"!?

Interfaces for which dhclient tries to get a lease are configurable, but
only on the commandline. I haven=B4t found any config option in
/etc/dhclient.conf. So I=B4ve hacked the /etc/init.d/dhcp-client file,
but that=B4s probably not Debian policy ;-).

Debian 2.2
Linux knus 2.2.15 #1 Thu Jun 1 10:47:16 EST 2000 i486 unknown

--=20
Uwe Storbeck <email address hidden>

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 18 Dec 2003 17:54:51 -0800
From: Matt Zimmerman <email address hidden>
To: <email address hidden>
Subject: Triage

reassign 65718 dhcp3-client
severity 65718 wishlist
merge 65718 208605
thanks

--
 - mdz

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 21423 has been marked as a duplicate of this bug. ***

Revision history for this message
Matt Zimmerman (mdz) wrote :

This seems to be a fairly common way to shoot oneself in the foot, and since it
breaks GNOME, we should fix it for 5.10 if we can do so without great risk

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

I'm sure I saw some patch or fix for this somewhere, will have a look and if
it's not too invasive (or an easy patch to make) I don't see why not.

Revision history for this message
Daniel Stone (daniels) wrote :

Below is my /etc/network/interfaces, which is as-generated by a pre-Hoary
install, dist-upgrade to Hoary through Breezy. I've only changed ath0 to DHCP
recently (previously it was iface ath0 inet manual, no options), and after doing
this, lo ends up down with no IP, at boot. It's been suggested that this bug is
at fault. Either way, it really f**king bites, and breaks your system in a
very, very non-obvious way.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
        script grep
        map eth0
        map ath0

# The primary network interface
iface eth0 inet manual
iface ath0 inet dhcp
    wireless_essid XXXXXX
    wireless_key s:XXXXXX
    wireless_nick ephemera

Revision history for this message
Michael Vogt (mvo) wrote :

Created an attachment (id=4522)
patch that should fix the problem

The problem seems to be that dhclient tries to stay away from non-broadcast
interfaces but has a #if defined (LINUX_SLASHPROC_DISCOVERY) later that dosn't
do this sort of check for the found interfaces.

I tested the patch only lightly, feedback is welcome.

Revision history for this message
Michael Vogt (mvo) wrote :

Fixed with the upload of dhcp3_3.0.3-5ubuntu2.

Changed in dhcp3 (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.