]> git.proxmox.com Git - mirror_ifupdown2.git/commit
addons: addressvirtual: ifquery -r doesn't display link-local address
authorJulien Fortin <julien@cumulusnetworks.com>
Mon, 8 Oct 2018 13:18:32 +0000 (15:18 +0200)
committerJulien Fortin <julien@cumulusnetworks.com>
Thu, 13 Dec 2018 22:43:57 +0000 (14:43 -0800)
commitc3175b312ba63af8fef0412b528c10f5f76f3e33
treeb3af3aed0ed6b223296e70cf2bf1f179ec7689ef
parentd665f4f10ee1613db70d08ec43417d60e2174fed
addons: addressvirtual: ifquery -r doesn't display link-local address

The issue here lies with how we query the cache to get the ips addresses
configured on the macvlan. A few months ago we added support for link scope
addresses in the cache, since the kernel may add it's own link addresse to
some interfaces we need to filter them out when querying the cache (because
we just want to get the list of IPs managed by ifupdown2). To perform this
filtering we need to look at the current user configuration (/e/n/i) but we
also need to look at past configuration. To perform this filtering we need
to provide the API LinkUtils:get_running_addrs a special parameter for
address-virtual (we need an ifaceobj).

$ ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto vlan1000
iface vlan1000
address 192.168.10.2/24
address fc00:10::2/64
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64
address-virtual-ipv6-addrgen off
vlan-id 1000
vlan-raw-device bridge
vrf blue

auto bridge
iface bridge
bridge-ports swp1

auto blue
iface blue
vrf-table auto

$ ifreload -a
$ echo $?
0
$ ifquery -a -c
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp                                                [pass]

auto vlan1000
iface vlan1000                                                      [pass]
vlan-raw-device bridge                                      [pass]
vlan-id 1000                                                [pass]
vrf blue                                                    [pass]
address 192.168.10.2/24                                     [pass]
address fc00:10::2/64                                       [pass]
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fc00:10::1/64 fe80::1/64     [pass]
address-virtual-ipv6-addrgen off                            [pass]

auto bridge
iface bridge                                                        [pass]
bridge-ports swp1                                           [pass]

auto blue
iface blue                                                          [pass]
vrf-table 1001                                              [pass]

$ ifquery -r vlan1000
auto vlan1000
iface vlan1000
vlan-id 1000
vlan-protocol 802.1Q
vlan-raw-device bridge
address 192.168.10.2/24
address fc00:10::2/64
address-virtual 00:00:5e:00:01:01 192.168.10.1/24 fe80::1/64 fc00:10::1/64
address-virtual-ipv6-addrgen off

$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
ifupdown2/addons/addressvirtual.py