rtnl: Ignore netlink messages generated by wext
This is a back-port, commit ID in connman upstream is
baca46719603974ed6849996c50a66f4ebeb5ff1
Partially fixes TIVI-164.
ConnMan should just ignore netlink messages generated by wext
as described in commit
4997f6e38f34effc00179e849dee0dc2e2263d3a.
Handle wext message detection using the IFLA_WIRELESS type
because the ifinfomsg ifi_change field is reserved for future
use and code using it for wext detection has been removed.
wifi: Fix tethering with kernel 3.5
This is a back-port, commit ID in connman upstream is
0102a3fb69c0e4ba5504f9ae4fe7d94998813373
Partially fixes TIVI-164.
Wifi tethering works with kernel 3.4, but not with 3.5. Bisecting
showed that the following kernel patch causes the breakage:
"3edaf3e mac80211: manage AP netdev carrier state".
Running connman with debugging enabled showed that in case of 3.4
we have the following sequence of RTM_NEWLINK events from the kernel:
1. IFF_UP not set, ifi_change=1
2. IFF_UP,IFF_LOWER_UP, ifi_change=1
which makes connman do the following:
connmand[210]: plugins/wifi.c:wifi_newlink() index 4 flags 4098 change 1
connmand[210]: plugins/wifi.c:wifi_newlink() interface down
connmand[210]: plugins/wifi.c:wifi_newlink() index 4 flags 69635 change 1
connmand[210]: plugins/wifi.c:wifi_newlink() interface up
connmand[210]: plugins/wifi.c:wifi_newlink() carrier on
connmand[210]: plugins/wifi.c:handle_tethering() index 4 bridge tether
However, in 3.5 we have the following sequents of events from the kernel:
1. IFF_UP, ifi_change=1
2. IFF_UP,IFF_LOWER_UP, ifi_change=0
which makes connman do the following:
connmand[493]: plugins/wifi.c:wifi_newlink() index 4 flags 4099 change 1
connmand[493]: plugins/wifi.c:wifi_newlink() interface up
connmand[493]: plugins/wifi.c:wifi_newlink() index 4 flags 69635 change 0
The root-cause for it is that connman handles the "ifi_change" flag
incorrectly. Connman interprets it as "if non-zero, there was some change",
which is wrong. According to RFC 3549, it is "reserved for future use.
Must be set to 0xFFFFFFFF". Thus, just remove that check, which makes
tethering work.
tethering: Re-add error message about missing bridge functionality
This is back-port from upstream. Commit ID in upstream is
18d852960a02a9939616787043cddea68e92f226
Commit 4fe07df removed an error message about missing bridge functionality.
Return it back.
Change-Id: Icbb4f6435f04eba436daf0c53c39696e45cdd50a
tethering: Fix bridge module loading problem
This is back-port from upstream. Commit ID in upstream is
4fe07dfed4f720136ee142e56a9d43242c8c78dc. Fixes TIVI-166.
Connman tries to check if bridging is supported by the kernel by checking
whether "/proc/sys/net/bridge" is present. If the bridge is a kernel
module which is not already loaded, then tethering cannot be enabled.
Instead of checking for the file we invoke the "get bridge version" socket
ioctl and the kernel will handle module loading issues - if the bridge
module is not loaded, it will first load it, and then check the version.
Change-Id: I5d9e15ca2fcab384c660c8b66ab5f184067545b1
tethering: Re-add error message about missing bridge functionality
This is back-port from upstream. Commit ID in upstream is
18d852960a02a9939616787043cddea68e92f226
Commit 4fe07df removed an error message about missing bridge functionality.
Return it back.
tethering: Fix bridge module loading problem
This is back-port from upstream. Commit ID in upstream is
4fe07dfed4f720136ee142e56a9d43242c8c78dc. Fixes TIVI-166.
Connman tries to check if bridging is supported by the kernel by checking
whether "/proc/sys/net/bridge" is present. If the bridge is a kernel
module which is not already loaded, then tethering cannot be enabled.
Instead of checking for the file we invoke the "get bridge version" socket
ioctl and the kernel will handle module loading issues - if the bridge
module is not loaded, it will first load it, and then check the version.
Change-Id: I5d9e15ca2fcab384c660c8b66ab5f184067545b1