With older versions of iw we can not get the channel that we
are currently associated with. So we cannot detect if we have
to fallback to that channel. Because of this, hostapd exits
with the following errors:
Failed to set beacon parameters
Interface initialization failed
ap0: interface state UNINITIALIZED->DISABLED
ap0: AP-DISABLED
ap0: Unable to setup interface.
hostapd_free_hapd_data: Interface ap0 wasn't started
A solution is to get the frequency from 'iw dev wlanN link' and
convert it to the channel number.
Fix#50
If someone have 2 adapters with the same hardware, there is a possibility
the first 5 bytes of their mac address to be the same.
I this case we will have mac address collision if we change both of them to
XX:XX:XX:XX:XX:14, one way to avoid this is to add 1 to their last byte.
Fix#47
In some Linux distributions (e.g. Ubuntu, Debian), udev automatically renames any device with its name prefix is "eth*", "wlan*",... as declared in "/lib/udev/rules.d/75-persistent-net-generator.rules". This made a problem when creating a virtual device on these distributions declaring that device not found. Solution was to change virtual device's name prefix to "ap*" to avoid this collision.
Ubuntu has a bit different setup than other distributions and because
of this dnsmasq was failing to retrieve the results of a DNS lookup.
This can be fixed if we specify that the listen-address is the gateway
instead of binding all the addresses of the WIFI_IFACE.
Fix#46
With the 6a3e1d98 commit NetworkManager was throwing an assertion so
we take a different approach when we create the bridge interface.
Also if the <interface-with-internet> is already a bridge interface
we skip creation.
The new approach is:
1) Save the IPs and route table of INTERNET_IFACE
2) If NetworkManager is running set INTERNET_IFACE as unmanaged
3) Create BRIDGE_IFACE and add INTERNET_IFACE to it
4) Set the previously saved IPs and route table to BRIDGE_IFACE
Better fix#19
To initialize the bridge interface correctly we need to do the following:
1) duplicate the IPs of INTERNET_IFACE to BRIDGE_IFACE
2) duplicate routing table of INTERNET_IFACE to BRIDGE_IFACE
3) delete routing table of INTERNET_IFACE
NOTE: we don't need to delete the IPs of INTERNET_IFACE
We need the above because BRIDGE_IFACE is the master interface from now on
and it must know where is connected, otherwise connection is lost.
Fix#19
Form NetworkManager 0.9.10 and above they introduce 'interface-name:'
for 'unmanaged-devices', use this method instead of 'mac:' since it
reduce many problems.
Fix#33
Some virtual interfaces have a different MAC address from their real
interfaces and their drivers disallow us to change it. In this case
we don't need to change the MAC address anyway.
With this we can avoid errors like 'RTNETLINK answers: Invalid argument'.