Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 98539 - IPv6 stateless autoconfiguration + IPv4 DHCP breaks down with dhclient and udhcpc
Summary: IPv6 stateless autoconfiguration + IPv4 DHCP breaks down with dhclient and ud...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-07-10 02:05 UTC by Antti Mäkelä
Modified: 2005-07-14 03:01 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Mäkelä 2005-07-10 02:05:53 UTC
When I have a network that uses DHCP for dynamic IP address assignment for IPv4 and stateless autoconfiguration for IPv6 (not DHCP), the scripts for dhclient and udhcpc break down IPv6 connectivity.

/lib/rcscripts/net.modules.d/helpers.d/udhcpc-ifconfig

which is used by both dhclient and udhcpc

has a specific section commented

        # Remove all addresses
        while ifconfig ${interface} | grep -q -m1 -o 'inet addr:[^ ]*' ; do
                ifconfig ${interface} 0.0.0.0 || break
        done

        # Remove IPv6 addresses
        for i in $( ifconfig ${interface} | awk '$1=="inet6" && $4!="Scope:Link"
 {print $3}' ); do
                ifconfig ${interface} inet6 del ${i}
        done

  This is all well and good in the case where IPv6 addresses are also assinged via DHCP, but if I'm only interested in getting IPv4 to work with DHCP this thing wipes out my IPv6 address completely.

  I can actually see this happening by activating my network interface. By repeatedly typing "ifconfig" I can briefly see my global IPv6 address (2001:...) until the dhcp script takes over and removes it.

  With dhcpcd this does not happen because the helper function does not touch ipv6 addresses.

  Steps to repeat

  1. Install dhclient or udhcpc
  2. Tell /etc/conf.d/net to use above modules
  3. Activate your interface in a network that uses dhcp for ipv4 but not for ipv6.
  4. Keep typing "ifconfig" and notice the brief moment when the interface has global ipv6 address.

  What should happen:

  Global ipv6 address should remain.

  Proposed solution:

  Configuration statement in /etc/conf.d/net that states whether the IPv6 is 
  - inactive
  - stateless (no DHCP) autoconfig
  - stateful (DHCP) autoconfig
  - combined (stateless for IPv6 addresses, DHCP is used only for DNS and similar info).

  (Stateless autoconfig happens by the kernel's IPv6 stack automatically, and can be enabled/disabled with sysctl net.ipv6.conf.eth0.autoconf, values 1 or 0)

  For now my specific solution is to remove the portion of scripts that removes IPv6 addresses..
Comment 1 Roy Marples (RETIRED) gentoo-dev 2005-07-11 06:45:53 UTC
As dhclient and udhcpc don't deal with IPv6, I've removed the code that erases
IPv6 information from the code.

Will be in baselayout-1.11.13
Comment 2 Roy Marples (RETIRED) gentoo-dev 2005-07-14 03:01:56 UTC
baselayout-1.11.13 is out