diff --git a/snapcraft.yaml b/snapcraft.yaml index 1016d644..cdba714a 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -81,5 +81,5 @@ parts: stage-packages: [libc6, libnl-3-dev, libnl-genl-3-dev, libnl-route-3-dev] source: https://github.com/CanonicalLtd/probert.git source-type: git - source-commit: b94a83bdfa8653bda2fe3d50e0fed9f4e14beb3e + source-commit: 9ebfbbaab151ea58bd800b586a99f32fabd7cbf3 requirements: requirements.txt diff --git a/subiquitycore/models/network.py b/subiquitycore/models/network.py index ec878bd6..d2b1d0fe 100644 --- a/subiquitycore/models/network.py +++ b/subiquitycore/models/network.py @@ -16,7 +16,7 @@ import copy import ipaddress import logging -from socket import AF_INET, AF_INET6 +from socket import AF_INET, AF_INET6, if_indextoname from subiquitycore import netplan @@ -47,10 +47,9 @@ class Networkdev: self._net_info = net_info self._configuration = configuration if self.type == 'vlan': - # probably should parse /proc/self/net/vlan/config instead - link, vid = self.name.split('.') - self._configuration['id'] = int(vid) - self._configuration['link'] = link + self._configuration['id'] = net_info.netlink_data['vlan_id'] + self._configuration['link'] = if_indextoname( + net_info.netlink_data['vlan_link']) def render(self): if self.configured_ip_addresses or self.dhcp4 or self.dhcp6: