shared: add NMU_IFACE_OVS_OR_KERNEL for nm_utils_ifname_valid()

Depending on the type, OVS interfaces also have a corresponding netdev
in kernel (e.g. type "internal" does, type "patch" does not).

Such a case is neither NMU_IFACE_OVS nor NMU_IFACE_KERNEL (alone). There should
be a special type to represent those cases.

Add NMU_IFACE_OVS_OR_KERNEL for that.
This commit is contained in:
Thomas Haller 2020-02-18 16:51:03 +01:00
parent 807cddc754
commit 294de8487e
2 changed files with 4 additions and 0 deletions

View file

@ -4211,6 +4211,9 @@ nm_utils_ifname_valid (const char* name,
return _nm_utils_ifname_valid_kernel (name, error);
case NMU_IFACE_OVS:
return _nm_utils_ifname_valid_ovs (name, error);
case NMU_IFACE_OVS_AND_KERNEL:
return _nm_utils_ifname_valid_kernel (name, error)
&& _nm_utils_ifname_valid_ovs (name, error);
case NMU_IFACE_ANY: {
gs_free_error GError *local = NULL;

View file

@ -1681,6 +1681,7 @@ typedef enum {
NMU_IFACE_ANY,
NMU_IFACE_KERNEL,
NMU_IFACE_OVS,
NMU_IFACE_OVS_AND_KERNEL,
} NMUtilsIfaceType;
gboolean nm_utils_ifname_valid_kernel (const char *name, GError **error);