Kernel doesn't support SRv6 devices.  dpif_netlink_rtnl_create()
returns EOPNOTSUPP for them, but we should fail earlier during
verification.  We should also not call destroy() for them.

This change doesn't fix any real issues, but makes the code a
little cleaner.

Fixes: 03fc1ad78521 ("userspace: Add SRv6 tunnel support.")
Signed-off-by: Ilya Maximets <[email protected]>
---
 lib/dpif-netlink-rtnl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c
index ca803d0af..31ca35aae 100644
--- a/lib/dpif-netlink-rtnl.c
+++ b/lib/dpif-netlink-rtnl.c
@@ -128,9 +128,8 @@ vport_type_to_kind(enum ovs_vport_type type,
             return NULL;
         }
     case OVS_VPORT_TYPE_GTPU:
-        return NULL;
     case OVS_VPORT_TYPE_SRV6:
-        return "srv6";
+        return NULL;
     case OVS_VPORT_TYPE_BAREUDP:
         return "bareudp";
     case OVS_VPORT_TYPE_NETDEV:
@@ -517,12 +516,12 @@ dpif_netlink_rtnl_port_destroy(const char *name, const 
char *type)
     case OVS_VPORT_TYPE_ERSPAN:
     case OVS_VPORT_TYPE_IP6ERSPAN:
     case OVS_VPORT_TYPE_IP6GRE:
-    case OVS_VPORT_TYPE_SRV6:
     case OVS_VPORT_TYPE_BAREUDP:
         return dpif_netlink_rtnl_destroy(name);
     case OVS_VPORT_TYPE_NETDEV:
     case OVS_VPORT_TYPE_INTERNAL:
     case OVS_VPORT_TYPE_GTPU:
+    case OVS_VPORT_TYPE_SRV6:
     case OVS_VPORT_TYPE_UNSPEC:
     case __OVS_VPORT_TYPE_MAX:
     default:
-- 
2.54.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to