From 2e9ed5ad782fb632f3a0bb026cd3a566ab3862d4 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 13 Sep 2019 20:41:23 +0200 Subject: bonding: T1660: bugfix for triggered OS permission denied exception Some bond modes do not support arp monitor interval and thus internally eset it to 0 which means disabled. If you then write to the sysfs file in question an OS exception (permission denied) is triggered. arp_mon_intvl is initialized as 0 which means disabled so we only write it when it is really requested by the user. There is a validator ensuring that it can only be set in the bond modes which support it. --- src/conf_mode/interface-bonding.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py index dc0363fb7..08bc4857b 100755 --- a/src/conf_mode/interface-bonding.py +++ b/src/conf_mode/interface-bonding.py @@ -354,12 +354,12 @@ def apply(bond): for intf in b.get_slaves(): b.del_port(intf) - # ARP link monitoring frequency - b.arp_interval = bond['arp_mon_intvl'] - # reset miimon on arp-montior deletion + # ARP link monitoring frequency, reset miimon when arp-montior is inactive if bond['arp_mon_intvl'] == 0: # reset miimon to default b.bond_miimon = 250 + else: + b.arp_interval = bond['arp_mon_intvl'] # ARP monitor targets need to be synchronized between sysfs and CLI. # Unfortunately an address can't be send twice to sysfs as this will -- cgit v1.2.3