daemon: revert wlan mac learning change, due to undesired default behavior, there may be some cases where this behavior is desired, so the option to enable a promiscuous mode has been added and will be present in core-pygui

This commit is contained in:
Blake Harnden 2020-12-10 15:16:05 -08:00
parent d1c2b1bdb9
commit e7320a61a6
3 changed files with 23 additions and 6 deletions

View file

@ -286,14 +286,15 @@ class LinuxNetClient:
return True
return False
def disable_mac_learning(self, name: str) -> None:
def set_mac_learning(self, name: str, value: int) -> None:
"""
Disable mac learning for a Linux bridge.
Set mac learning for a Linux bridge.
:param name: bridge name
:param value: ageing time value
:return: nothing
"""
self.run(f"{IP} link set {name} type bridge ageing_time 0")
self.run(f"{IP} link set {name} type bridge ageing_time {value}")
class OvsNetClient(LinuxNetClient):

View file

@ -32,7 +32,8 @@ if TYPE_CHECKING:
WirelessModelType = Type[WirelessModel]
ebtables_lock = threading.Lock()
LEARNING_DISABLED: int = 0
ebtables_lock: threading.Lock = threading.Lock()
class EbtablesQueue:
@ -946,7 +947,7 @@ class HubNode(CoreNetwork):
:return: nothing
"""
super().startup()
self.net_client.disable_mac_learning(self.brname)
self.net_client.set_mac_learning(self.brname, LEARNING_DISABLED)
class WlanNode(CoreNetwork):
@ -989,7 +990,6 @@ class WlanNode(CoreNetwork):
:return: nothing
"""
super().startup()
self.net_client.disable_mac_learning(self.brname)
ebq.ebchange(self)
def attach(self, iface: CoreInterface) -> None: