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

Message ID 20180607141119.30098-1-fbl@redhat.com
State Accepted
Headers show
Series
  • [ovs-dev] linux: disable netns support for tap.
Related show

Commit Message

Flavio Leitner June 7, 2018, 2:11 p.m.
Tap device is not added to the kernel datapath, so there is
no way to get netns information.

Reported-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
 lib/netdev-linux.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Eelco Chaudron June 7, 2018, 2:33 p.m. | #1
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@redhat.com>
> Signed-off-by: Flavio Leitner <fbl@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@redhat.com>
Tested-by: Eelco Chaudron <echaudro@redhat.com>
Ben Pfaff June 14, 2018, 10:58 p.m. | #2
On Thu, Jun 07, 2018 at 04:33:39PM +0200, Eelco Chaudron wrote:
> 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@redhat.com>
> >Signed-off-by: Flavio Leitner <fbl@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@redhat.com>
> Tested-by: Eelco Chaudron <echaudro@redhat.com>

Thanks Flavio (and Eelco).  I applied this to master.

Patch

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;