[ovs-dev] [PATCH] linux: disable netns support for tap.

Eelco Chaudron echaudro at redhat.com
Thu Jun 7 14:33:39 UTC 2018


On 07/06/18 16:11, Flavio Leitner wrote:
> Tap device is not added to the kernel datapath, so there is
> no way to get netns information.
>
> Reported-by: Eelco Chaudron <echaudro at redhat.com>
> Signed-off-by: Flavio Leitner <fbl at redhat.com>
> ---
>   lib/netdev-linux.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index 10c1e4386..4c37d945a 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -604,7 +604,11 @@ static int
>   netdev_linux_netnsid_update(struct netdev_linux *netdev)
>   {
>       if (netnsid_is_unset(netdev->netnsid)) {
> -        return netdev_linux_netnsid_update__(netdev);
> +        if (netdev_get_class(&netdev->up) == &netdev_tap_class) {
> +            netnsid_set_local(&netdev->netnsid);
> +        } else {
> +            return netdev_linux_netnsid_update__(netdev);
> +        }
>       }
>   
>       return 0;

Acked-by: Eelco Chaudron <echaudro at redhat.com>
Tested-by: Eelco Chaudron <echaudro at redhat.com>



More information about the dev mailing list