mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
Merging from uCentral-trunk. The switch in the IPQ807x/IPQ60xx devices will automatically learn the mac addresses behind a port. But it will not unlearn this entry when some mac switches from the ethernet port to the CPU port. This will for example happens when a device roams from on AP to another AP. At least when both are APs are bridging the wifi traffic directly or indirectly (mesh) to the same ethernet broadcast domain. As result, the roaming device can no longer receive any ethernet packets which the AP is expected to receive on the ethernet port. This state will be kept for a couple of minutes until the entry in the FDB is dropped automatically. But it is still possible for the wifi device to send data via the ethernet during this whole time. One solution is to just disable learning on all ports. The other option would be to enable the qca bridge-mgr which takes care of gathering the events from the bridge and forwards it to the qca-ssdk (to manipulate the state of the switch). The latter option was chosen to follow the approach which QCA is also using in their QSDK. Signed-off-by: ravi vaishnav <ravi.vaishnav@netexperience.com>
70 lines
1.8 KiB
Bash
70 lines
1.8 KiB
Bash
#!/bin/sh /etc/rc.common
|
|
|
|
###########################################################################
|
|
# Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
|
# Permission to use, copy, modify, and/or distribute this software for
|
|
# any purpose with or without fee is hereby granted, provided that the
|
|
# above copyright notice and this permission notice appear in all copies.
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
|
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
###########################################################################
|
|
|
|
ecm_disable() {
|
|
if [ ! -d /sys/module/ecm ]; then
|
|
return
|
|
fi
|
|
|
|
echo 1 > /sys/kernel/debug/ecm/front_end_ipv4_stop
|
|
echo 1 > /sys/kernel/debug/ecm/front_end_ipv6_stop
|
|
echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all
|
|
sleep 2
|
|
}
|
|
|
|
ecm_enable() {
|
|
if [ ! -d /sys/module/ecm ]; then
|
|
return
|
|
fi
|
|
|
|
echo 0 > /sys/kernel/debug/ecm/ecm_db/defunct_all
|
|
echo 0 > /sys/kernel/debug/ecm/front_end_ipv4_stop
|
|
echo 0 > /sys/kernel/debug/ecm/front_end_ipv6_stop
|
|
}
|
|
|
|
restart() {
|
|
ecm_disable
|
|
|
|
/etc/init.d/openvpn stop
|
|
rmmod qca-nss-ovpn-link
|
|
rmmod qca-nss-ovpn-mgr
|
|
|
|
insmod qca-nss-ovpn-mgr
|
|
insmod qca-nss-ovpn-link
|
|
|
|
if [ "$?" -gt 0 ]; then
|
|
echo "Failed to load plugin. Please start ecm if not done already"
|
|
ecm_enable
|
|
return
|
|
fi
|
|
|
|
ecm_enable
|
|
}
|
|
|
|
start() {
|
|
restart
|
|
}
|
|
|
|
stop() {
|
|
ecm_disable
|
|
|
|
/etc/init.d/openvpn stop
|
|
rmmod qca-nss-ovpn-link
|
|
rmmod qca-nss-ovpn-mgr
|
|
|
|
ecm_enable
|
|
}
|