Bug 729183

Summary: HostAPD removes IPv6 addresses from interface in manged mode
Product: [Fedora] Fedora Reporter: Trever Adams <trever>
Component: hostapdAssignee: John W. Linville <linville>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: hansgeorg.schwibbe, linville, negativo17, notting, pierre-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1065673 (view as bug list) Environment:
Last Closed: 2013-11-22 19:41:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Trever Adams 2011-08-08 23:59:22 UTC
Description of problem:
On World IPv6 day I noticed that hostapd removes any non-fe80 address from the interface it starts on. This is documented at http://hostap.epitest.fi/bugz/show_bug.cgi?id=298

There is a possible solution there, though it seems it may not handle multiple IPv6 addresses on the same interface.

Is it possible to get a fix like this into the official Fedora package.

Version-Release number of selected component (if applicable):

How reproducible:
Every time

Steps to Reproduce:
1. Setup an AP with hostapd, configure ifcfg-wlan0 or whatever to have an IPv6 address
2. Start hostapd
3. No IPv6 addresses

Comment 1 Pete Zaitcev 2011-10-19 03:37:50 UTC
The solution offered in the upstream bug is to set addresses by hooking around
hostpad. This stinks of a band-aid. Root cause is not identified. What does
the upstream say about this on mailing lists?

Comment 2 Pete Zaitcev 2011-10-19 03:52:55 UTC
I think what must be confusing John here is that hostapd by itself does
nothing. Try to remove all addresses before running hostapd. The hostapd
will configure the interface for wireless, but not add even IPv4 addresses.

Comment 3 Trever Adams 2011-10-19 12:49:11 UTC
Yes, this is very strange. I couldn't find any code that sets or unsets ip addresses in HostAPD. However, I can set an IPv6 address and the moment hostapd starts, it kills the address. Maybe this is a kernel bug?

Comment 4 John W. Linville 2011-10-19 14:15:55 UTC
I think the config is being lost when the device is brought down and its mode is changed to make it an AP.  What have you got in ifcfg-wlan0?

Comment 5 Pete Zaitcev 2011-10-19 15:22:17 UTC
Just in case: my interface is renamed. It's not called "wlan0", but "wlanhome".
This is done by this:

[root@elanor tmp]# cat /etc/udev/rules.d/70-persistent-net.rules
# USB device 0x0b95:0x7720 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:b6:07:42:03", ATTR{type}=="1", KERNEL=="eth*", NAME="ethmodem"

# PCI device 0x14e4:0x4311 (b43 from niphredil)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:19:7d:a7:fc:36", ATTR{type}=="1", NAME="wlanhome"

This may be relevant, if we find that Trever's interface is renamed too
(his original report says "wlan0 _or whatever_").

Here's the /etc/sysconfig/network-scripts/ifcfg-wlanhome:

# See also /etc/udev/rules.d/70-persistent-net.rules
# b43 from niphredil
# This is a lie, hostapd brings this device up on boot.
# However, if we put "no" here, dhcp races hostapd and fails to listen.
# radvd bails without a link-local address

I would like to underscore that this configuration worked for a long
time, perhaps since Fedora 10. I started serving IPv6 on wireless about
2 years ago. It's some kind of recent regression, came with Fedora 15
or maybe even an update inside Fedora 15.

In Fedora 14 there was a regression where secondary IPv6 address stopped
being applied, but that was fixed. I think maybe the component should
be initscripts, not hostapd.

Comment 6 John W. Linville 2011-10-19 17:45:08 UTC
Bill, any thoughts on comment 5?

Comment 7 Bill Nottingham 2011-10-19 19:32:29 UTC
Given the upstream bug reporter is on Debian, I can't imagine it's anything specific to our initscripts.

Comment 8 Trever Adams 2011-10-19 19:49:00 UTC

IPv6 link-local always gets assigned on my system. However, the IPv6 addresses assigned in the ifcfg-wlan0 NEVER get assigned. If I assign them with this or any other method, then bring up hostapd, they disappear. I can add them AFTER it gets started and they work find.

Comment 9 Trever Adams 2012-06-19 04:47:32 UTC
This is still a problem.

Comment 10 Pierre Ossman 2013-03-05 21:04:34 UTC

Comment 11 Trever Adams 2013-03-05 21:37:30 UTC
Yes, this is still a problem.

Comment 12 John W. Linville 2013-03-05 21:53:32 UTC
The device has to go down to switch modes when starting the AP.  Taking the device down causes the kernel to drop its network address configuration.  What is it that you expect to be responsible for replacing that configuration?

Comment 13 Pierre Ossman 2013-03-06 06:09:37 UTC
Well something. I expect the components of the distribution to work together. :)

So either retrigger the normal configuration routines (which I guess would mean integration with NM or initscripts), or hostapd should store and restore any configuration it nukes as part of fiddling with the device.

And why are only some things affected? The IPv4 address isn't dropped.

Comment 14 John W. Linville 2013-11-22 19:41:21 UTC
I really don't have an answer for you.  I suggest that you raise this issue with the upstream project.

Comment 15 hansgeorg.schwibbe 2014-02-15 16:52:57 UTC

I have the same problem with my Raspberry Pi configured as wireless access point.

I used the following tutorial to setup my raspberry pi as wireless access point:

The wlan interface is configured with a static IP address:
 iface wlan0 inet static

My hostapd config is as follows:

The configuration seems to work fine, but somtimes when the router comes up, wlan0 has no IP address. 

So I tried to find the cause for this issue, and I figured the following out.

When I restart networking the IP address is allways available
sudo /etc/init.d/networking stop
sudo /etc/init.d/networking start

But everytime I start/restart hostapd the static IP address goes away. It looks like hostapd is doing something nasty with the wireless network interface.