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>
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;
}