]> git.proxmox.com Git - mirror_ovs.git/commitdiff
linux: Assume it is local if no API is available.
authorFlavio Leitner <fbl@redhat.com>
Thu, 7 Jun 2018 14:10:52 +0000 (11:10 -0300)
committerBen Pfaff <blp@ovn.org>
Thu, 14 Jun 2018 23:06:11 +0000 (16:06 -0700)
If the 'openvswitch' kernel module is not loaded, the API is not
available and the userspace will keep retrying. This approach is
not ideal for the netdev datapath type.

This patch disables network netns support if the error code returned
indicates that the API is not available.

Reported-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Tested-by: Eelco Chaudron <echaudro@redhat.com>
lib/netdev-linux.c

index e2bbbb827434c4258c49967ea9a474a17e4640d7..1d2b7ea4cd00a527cb19ae1f673ca9826cbcebfb 100644 (file)
@@ -587,7 +587,13 @@ netdev_linux_netnsid_update__(struct netdev_linux *netdev)
 
     error = dpif_netlink_vport_get(netdev_get_name(&netdev->up), &reply, &buf);
     if (error) {
-        netnsid_unset(&netdev->netnsid);
+        if (error == ENOENT) {
+            /* Assume it is local if there is no API (e.g. if the openvswitch
+             * kernel module is not loaded). */
+            netnsid_set_local(&netdev->netnsid);
+        } else {
+            netnsid_unset(&netdev->netnsid);
+        }
         return error;
     }