@@ -614,7 +614,12 @@ static int
netdev_linux_netnsid_update(struct netdev_linux *netdev)
{
if (netnsid_is_unset(netdev->netnsid)) {
- if (netdev_get_class(&netdev->up) == &netdev_tap_class) {
+ const char *dpif_type = netdev_get_dpif_type(&netdev->up);
+
+ if (netdev_get_class(&netdev->up) == &netdev_tap_class
+ || (dpif_type && strcmp(dpif_type, "system"))) {
+ /* vport netlink lookup makes no sense for
+ * non-system dpif types, set nsid to local. */
netnsid_set_local(&netdev->netnsid);
} else {
return netdev_linux_netnsid_update__(netdev);
For ports on non-system (i.e. userspace) datapaths, the dpif_netlink_vport_get() call in netdev_linux_netnsid_update() is meaningless, these ports are not kernel vports. Generalize the tap class check in netdev_linux_netnsid_update() with a dpif_type check: when dpif_type is set and is not "system", assume the device is local without attempting the vport lookup. This change will cover all device types on userspace datapaths (e.g. veth pairs). Signed-off-by: Matteo Perin <matteo.perin@canonical.com> --- lib/netdev-linux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)