From: Ondrej Lichtner <olichtne(a)redhat.com>
Set the flags attribute for ip address objects when created from an
RTM_NEWADDR netlink message.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Devices/Device.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py
index 1ec7433..3984776 100644
--- a/lnst/Devices/Device.py
+++ b/lnst/Devices/Device.py
@@ -203,7 +203,8 @@ def _update_netlink(self, nl_msg):
if nl_msg['header']['type'] == RTM_NEWLINK:
self._nl_msg = nl_msg
elif nl_msg['header']['type'] == RTM_NEWADDR:
- addr = ipaddress(nl_msg.get_attr('IFA_ADDRESS'))
+ addr = ipaddress(nl_msg.get_attr('IFA_ADDRESS'),
+ flags=nl_msg.get_attr("IFA_FLAGS"))
addr.prefixlen = nl_msg["prefixlen"]
if addr not in self._ip_addrs:
--
2.22.0