Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5356 closed defect (fixed)

IPv6 Addresses configuration is not applied to the interfaces

Reported by: zioproto@… Owned by: developers
Priority: high Milestone: Kamikaze 8.09.2
Component: base system Version: Kamikaze 8.09
Keywords: ipv6, ip, address Cc:

Description

I build today OpenWRT 8.09 at r16482 for my Linksys WRT54GL.

I have an interface with the following configuration:

config interface lan
       option ifname "eth0.0"
       option proto   static
       option ipaddr  192.168.50.1
       option ip6addr "fec0:50::1/64"
       option netmask 255.255.255.0

When OpenWRT boots the IPv6 address is not configured to the interface. However, if I manually launch /etc/init.d/network restart once the system is running, then the IPv6 address is configured to the interface.

Attachments (1)

0001--package-base-files-make-hotplug-load-ipv6-fixes.patch (973 bytes) - added by Malte S. Stretz <mss@…> 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by Malte S. Stretz <mss@…>

Now I was bitten by this bug as well, logread tells me:

[...]
Jun  1 11:21:00 SixWrt user.info kernel: Freeing unused kernel memory: 128k freed
Jun  1 11:21:00 SixWrt user.warn kernel: Please be pat
Jun  1 11:21:00 SixWrt user.info kernel: ient, while OpenWrt loads ...
Jun  1 11:21:00 SixWrt user.warn kernel: Algorithmics/MIPS FPU Emulator v1.5
Jun  1 11:21:00 SixWrt user.info hotplug: interface loopback goes up
Jun  1 11:21:00 SixWrt daemon.info dnsmasq: waiting 1 second for poll of /tmp/resolv.conf.auto
Jun  1 11:21:00 SixWrt user.info sysinit: udhcpc (v1.11.2) started
Jun  1 11:21:01 SixWrt user.info sysinit: ifconfig: socket(AF_INET6): Address family not supported by protocol
Jun  1 11:21:01 SixWrt user.info hotplug: interface wan goes down
Jun  1 11:21:01 SixWrt user.info kernel: NET: Registered protocol family 10
Jun  1 11:21:01 SixWrt user.info kernel: lo: Disabled Privacy Extensions
Jun  1 11:21:01 SixWrt user.info kernel: ADDRCONF(NETDEV_UP): eth0: link is not ready
Jun  1 11:21:01 SixWrt user.info kernel: tun: Universal TUN/TAP device driver, 1.6
Jun  1 11:21:01 SixWrt user.info kernel: tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Jun  1 11:21:01 SixWrt user.info kernel: IPv6 over IPv4 tunneling driver
Jun  1 11:21:01 SixWrt user.info kernel: sit0: Disabled Privacy Extensions
Jun  1 11:21:01 SixWrt daemon.info dnsmasq: waiting 1 second for poll of /tmp/resolv.conf.auto
Jun  1 11:21:02 SixWrt user.info kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Jun  1 11:21:02 SixWrt user.info sysinit: route: fscanf
[...]

Note the ifconfig error at 11:21:01. As I wrote on the list, I guess the ipv6 module isn't loaded at that point. Going to figure out, why...

comment:2 Changed 8 years ago by Malte S. Stretz <mss@…>

Ok, here's the problem: The interfaces are brought up on boot not by /etc/init.d/network but by hotplug executing /etc/hotplug.d/net/10-net -- my guess is that this happens when the kernel is told which hotplug app to use in /etc/preinit. Whatever, this leads to the interfaces being enabled before all modules are loaded via /etc/init.d/S10boot. Thats also the reason (I guess) why boot() in /etc/init.d/network doesn't do much.

As this is totally unpredictable and I can't see any reason why the network shouldn't be handled like everything else, my proposal is to add a flag to /etc/hotplug.d/net/10-net which doesn't setup the interfaces when it is called on boot and let /etc/init.d/S40network do its work as expected.

The only thing I'm not sure about is how to detect that hotplug was called on boot and not later on. The easiest would probably be to set an environment variable when /etc/preinit starts up and clear it when it was finished. Hmmm... no, this won't work as hotplug-call won't inherit the environment. So a flag stored in a file or via uci_set_state is probably the way to got. Comments?

Changed 8 years ago by Malte S. Stretz <mss@…>

comment:3 Changed 8 years ago by Malte S. Stretz <mss@…>

Here's the discussed hacky solution to fix this for 8.09 without touching the rest of the init script. A nicer solution for trunk will follow on the list.

comment:4 Changed 8 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Should be solved with r17118.

comment:5 Changed 8 years ago by Malte S. Stretz <mss@…>

The committed patch doesn't work for my setup. Seems like it the if block is never entered. Still tracing...

comment:6 Changed 8 years ago by Malte S. Stretz <mss@…>

Here's the problem:

config 'interface' 'wan'
        option 'ifname' 'eth0'
        option 'proto' 'dhcp'

config 'alias' 'wan6'
        option 'proto' 'static'
        option 'interface' 'wan'
        option 'ip6addr' '2001:dead:c0de::1/64'

I need a DHCP interface with an additional static IPv6 address, so have to add it via an alias. And the ipv6-autoloading just doesn't work for aliases. Either the code has to be duplicated for aliases (and maybe other protos as well), or my simple solution be used. The latter is IMO better anyway: If ipv6 is in /etc/modules.d/*, it will be loaded anyway, so the net hotplug script preloading it doesn't hurt, no need to check if ipv6 is requested. Plus, that script is less often called than setup_interface and friends: net hotplug events are rare, iface events can happen more often.

comment:7 Changed 8 years ago by Malte S. Stretz <mss@…>

Fixed in r17217 (just for the records :).

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.