diff --git a/ifupdown2/addons/xfrm.py b/ifupdown2/addons/xfrm.py index b64727f..28833d5 100644 --- a/ifupdown2/addons/xfrm.py +++ b/ifupdown2/addons/xfrm.py @@ -39,7 +39,9 @@ except (ImportError, ModuleNotFoundError): class xfrm(Addon, moduleBase): - """ ifupdown2 addon module to create a xfrm interface """ + """ + ifupdown2 addon module to create a xfrm interface + """ _modinfo = { 'mhelp': 'xfrm module creates a xfrm interface for', 'attrs': { @@ -94,7 +96,6 @@ class xfrm(Addon, moduleBase): """ # Create a xfrm device on this device and set the virtual # router mac and ip on it - link_created = False xfrm_ifacename = self._get_xfrm_name(ifaceobj) physdev = self._get_parent_ifacename(ifaceobj) xfrmid = self._get_xfrmid(ifaceobj) @@ -135,6 +136,7 @@ class xfrm(Addon, moduleBase): def _query_check(self, ifaceobj, ifaceobjcurr): if not self.cache.link_exists(ifaceobj.name): return + ifaceobjcurr.status = ifaceStatus.SUCCESS def _query_running(self, ifaceobjrunning): diff --git a/ifupdown2/lib/iproute2.py b/ifupdown2/lib/iproute2.py index b2cc98d..12d14f5 100644 --- a/ifupdown2/lib/iproute2.py +++ b/ifupdown2/lib/iproute2.py @@ -333,9 +333,9 @@ class IPRoute2(Cache, Requirements): ### - @staticmethod - def link_add_xfrm(ifname, xfrm_name, xfrm_id): + def link_add_xfrm(self, ifname, xfrm_name, xfrm_id): utils.exec_commandl(['ip', 'link', 'add', xfrm_name, 'type', 'xfrm', 'dev', ifname, 'if_id', xfrm_id]) + self.__update_cache_after_link_creation(xfrm_name, "xfrm") ############################################################################ # TUNNEL diff --git a/ifupdown2/nlmanager/nlpacket.py b/ifupdown2/nlmanager/nlpacket.py index 02c2c1b..48b4c5d 100644 --- a/ifupdown2/nlmanager/nlpacket.py +++ b/ifupdown2/nlmanager/nlpacket.py @@ -2690,7 +2690,8 @@ class AttributeIFLA_LINKINFO(Attribute): "vti6": NetlinkPacket_IFLA_LINKINFO_Attributes.ifla_vti_to_string, "ipip": NetlinkPacket_IFLA_LINKINFO_Attributes.ifla_iptun_to_string, "sit": NetlinkPacket_IFLA_LINKINFO_Attributes.ifla_iptun_to_string, - "ip6tnl": NetlinkPacket_IFLA_LINKINFO_Attributes.ifla_iptun_to_string + "ip6tnl": NetlinkPacket_IFLA_LINKINFO_Attributes.ifla_iptun_to_string, + "xfrm": NetlinkPacket_IFLA_LINKINFO_Attributes.ifla_xfrm_to_string }, NetlinkPacket_IFLA_LINKINFO_Attributes.IFLA_INFO_SLAVE_DATA: { "bridge": NetlinkPacket_IFLA_LINKINFO_Attributes.ifla_brport_to_string, @@ -2756,7 +2757,8 @@ class AttributeIFLA_LINKINFO(Attribute): "ipip", "sit", "ip6tnl", - "ip6ip6" + "ip6ip6", + "xfrm" ): self.log.debug('Unsupported IFLA_INFO_KIND %s' % kind)