From dde72ce4f2d10a8a067cb84a1a8a872508d36b82 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 17 Nov 2018 17:06:12 +0800 Subject: [PATCH] add sta bridge support --- .../patches/969-allow-sta-bridge.patch | 45 +++++++++++++++++++ .../network/services/hostapd/files/hostapd.sh | 3 -- 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 package/kernel/mac80211/patches/969-allow-sta-bridge.patch diff --git a/package/kernel/mac80211/patches/969-allow-sta-bridge.patch b/package/kernel/mac80211/patches/969-allow-sta-bridge.patch new file mode 100644 index 000000000..2da414cd1 --- /dev/null +++ b/package/kernel/mac80211/patches/969-allow-sta-bridge.patch @@ -0,0 +1,45 @@ +--- a/net/wireless/util.c 2018-01-22 23:10:57.014111703 -0500 ++++ b/net/wireless/util.c 2018-01-22 23:14:53.458313048 -0500 +@@ -1018,7 +1018,6 @@ + /* if it's part of a bridge, reject changing type to station/ibss */ + if ((dev->priv_flags & IFF_BRIDGE_PORT) && + (ntype == NL80211_IFTYPE_ADHOC || +- ntype == NL80211_IFTYPE_STATION || + ntype == NL80211_IFTYPE_P2P_CLIENT)) + return -EBUSY; + +@@ -1063,11 +1062,6 @@ + if (!err) { + dev->priv_flags &= ~IFF_DONT_BRIDGE; + switch (ntype) { +- case NL80211_IFTYPE_STATION: +- if (dev->ieee80211_ptr->use_4addr) +- break; +- /* fall through */ +- case NL80211_IFTYPE_OCB: + case NL80211_IFTYPE_P2P_CLIENT: + case NL80211_IFTYPE_ADHOC: + dev->priv_flags |= IFF_DONT_BRIDGE; +--- a/net/wireless/core.c 2018-01-22 23:10:57.002111693 -0500 ++++ b/net/wireless/core.c 2018-01-22 23:16:14.930379807 -0500 +@@ -1112,8 +1112,7 @@ + /* allow mac80211 to determine the timeout */ + wdev->ps_timeout = -1; + +- if ((wdev->iftype == NL80211_IFTYPE_STATION || +- wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || ++ if ((wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || + wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) + dev->priv_flags |= IFF_DONT_BRIDGE; + +--- a/net/wireless/nl80211.c 2018-01-22 23:10:57.010111699 -0500 ++++ b/net/wireless/nl80211.c 2018-01-22 23:17:24.366435886 -0500 +@@ -2695,8 +2695,6 @@ + enum nl80211_iftype iftype) + { + if (!use_4addr) { +- if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT)) +- return -EBUSY; + return 0; + } + diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 540d1182c..a62d3ed4f 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -646,9 +646,6 @@ wpa_supplicant_prepare_interface() { adhoc) fail=1 ;; - sta) - [ "$wds" = 1 ] || fail=1 - ;; esac [ -n "$fail" ] && {