mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: address: fix _cache_update to use the right set cache api
Ticket: CM-13967 Reviewed By: julien, nikhil Testing Done: tested failing config in the bug This patch fixes a cache_update problem caught during mtu updates. Cache updates were failing silently, leaving stale cache values. For the below config, ifupdown2 was falsely reporting an mtu error, because the cache had a stale mtu default value $ifquery peerlink-3 peerlink-3.4094 auto peerlink-3 iface peerlink-3 bond-slaves swp32s0 swp32s1 bond-mode 802.3ad mtu 9202 auto peerlink-3.4094 iface peerlink-3.4094 address 27.0.0.11/32 mtu 9202 $ifreload -a warning: peerlink-3.4094: vlan dev mtu 9202 is greater than lower realdev peerlink-3 mtu 1500 Before patch: sequence of events: - build cache with current system running mtu - link set mtu 9202 on peerlink-3 - update cache for peerlink-3 to 9202 <---- cache update fails - when processing peerlink-3.4094, query cache for lowerdev peerlink-3 mtu: this returns 1500 <--- stale cache value - print warning After patch: sequence of events: - build cache with current system running mtu - link set mtu 9202 on peerlink-3 - update cache for peerlink-3 to 9202 <---- cache updates to 9202 - when processing peerlink-3.4094, query cache for lowerdev peerlink-3 mtu: this returns 9202 - success and proceed Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
@@ -251,7 +251,7 @@ class iproute2(utilsBase):
|
|||||||
def _cache_update(self, attrlist, value):
|
def _cache_update(self, attrlist, value):
|
||||||
if ifupdownflags.flags.DRYRUN: return
|
if ifupdownflags.flags.DRYRUN: return
|
||||||
try:
|
try:
|
||||||
linkCache.add_attr(attrlist, value)
|
linkCache.set_attr(attrlist, value)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user