interface: use link executor on vlans too

This commit is contained in:
Ariadne Conill 2020-08-24 03:06:32 -06:00
parent 8e7c935cdf
commit 1384b38c78
2 changed files with 20 additions and 2 deletions

View file

@ -63,7 +63,11 @@ lif_interface_init(struct lif_interface *interface, const char *ifname)
interface->ifname = strdup(ifname);
lif_interface_use_executor(interface, strchr(ifname, '.') == NULL ? "link" : "vlan");
lif_interface_use_executor(interface, "link");
/* keep the 'vlan' executor as a config hint for backwards compatibility */
if (strchr(ifname, '.') != NULL)
lif_interface_use_executor(interface, "vlan");
}
bool

View file

@ -30,7 +30,9 @@ tests_init \
tunnel_legacy_rewrite \
tunnel_ifupdown2_dependency \
tunnel_ifupdown2_rewrite \
gre_dependency
gre_dependency \
vlan_explicit_learned_dependency \
vlan_guessed_learned_dependency
noargs_body() {
atf_check -s exit:1 -e ignore ifquery -S/dev/null
@ -192,3 +194,15 @@ gre_dependency_body() {
atf_check -s exit:0 -o match:"requires eth0" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/gre.interfaces tun0
}
vlan_explicit_learned_dependency_body() {
atf_check -s exit:0 -o match:"requires eth0" \
-o match:"use vlan" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/vlan-named.interfaces servers
}
vlan_guessed_learned_dependency_body() {
atf_check -s exit:0 -o match:"requires eth0" \
-o match:"use vlan" \
ifquery -E $EXECUTORS_LINUX -i $FIXTURES/vlan.interfaces eth0.8
}