public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "B.A.T.M.A.N" <b.a.t.m.a.n@lists.open-mesh.net>,
	b.a.t.m.a.n@lists.open-mesh.org,
	Antonio Quartulli <a@unstable.cc>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 3/4] batman-adv: Handle parent interfaces in a different netns
Date: Mon, 07 Mar 2016 15:45:23 +0100	[thread overview]
Message-ID: <2628096.3OTlO1qax0@bentobox> (raw)
In-Reply-To: <20160307143130.GB15541@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 2697 bytes --]

On Monday 07 March 2016 15:31:30 Andrew Lunn wrote:
> On Fri, Mar 04, 2016 at 01:35:01PM +0100, Sven Eckelmann wrote:
> > On Tuesday 01 March 2016 22:19:07 Andrew Lunn wrote:
> > > batman-adv tries to prevent the user from placing a batX soft
> > > interface into another batman mesh as a hard interface. It does this
> > > by walking up the devices list of parents and ensures they are all
> > > none batX interfaces. iflink can point to an interface in a different
> > > namespace, so also retrieve the parents name space when finding the
> > > parent and use it when doing the comparison.
> > > 
> > > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > > Acked-by: Antonio Quartulli <a@untable.cc>
> > > ---
> > >  net/batman-adv/hard-interface.c | 31 ++++++++++++++++++++++++-------
> > >  1 file changed, 24 insertions(+), 7 deletions(-)
> > 
> > Include missing in net/batman-adv/hard-interface.c
> > 
> >     #include <net/rtnetlink.h>
> 
> Hi Sven
> 
> How are you determining this? It compiled fine for me, which is my
> usual test.

https://git.open-mesh.org/build_test.git/blob/a246d227882b7bc03ae602b41cf65053397f9cc8:/checkstuff.sh#l311

> > 
> > Does anyone (not only Andrew) have a proposal regarding the compat code?
> > Patch 1+2 should be unproblematic (maybe these can already be applied?).
> 
> I've not much history with netns. One thing which might be interesting
> it know, is when did it become mature enough to the usable? Maybe for
> kernels older than v4.0, deny that netns exists, and find a way for
> functions like get_link_net() to return the default net.
> compat.h could contain
> 
> #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
> #if IS_ENABLED(CONFIG_NET_NS)
> #error Network Namespaces not support with this vintage of kernel. Please disable
> #endif
> #endif
> 
> You then know everything is going to be in the default namespace for
> these old kernels.

I think it is a good idea to deactivate it for too old kernels. But it
will explode in everyones face when build against the distro kernel.
But maybe letting some of the functions "fail" for old kernels might
be possible.

[...]
> #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
> #define dev->rtnl_link_ops->get_link_net true
> #define dev->rtnl_link_ops->get_link_net(dev) init_net
> #endif
[...]
> #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
> #define init_net.ns.inum 42
> #define net->ns.inum 42
> #endif

These defines should not work (I haven't actually tested them but they
should not work with all the . and ->). The preprocessor should fail
because it ends the preprocessor macro name with init_net and then
doesn't expect '.' to follow (only '(' or tab/space).

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-03-07 14:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 21:19 [B.A.T.M.A.N.] [PATCHv2 0/4] batman-adv: Add network name space support Andrew Lunn
2016-03-01 21:19 ` [B.A.T.M.A.N.] [PATCHv2 1/4] batman-adv: NETIF_F_NETNS_LOCAL feature to prevent netns moves Andrew Lunn
2016-03-13  9:29   ` Sven Eckelmann
2016-03-13 15:24     ` Andrew Lunn
2016-04-21 10:48       ` Marek Lindner
2016-03-01 21:19 ` [B.A.T.M.A.N.] [PATCHv2 2/4] batman-adv: Create batman soft interfaces within correct netns Andrew Lunn
2016-03-13 10:48   ` Sven Eckelmann
2016-03-13 15:35     ` Andrew Lunn
2016-03-01 21:19 ` [B.A.T.M.A.N.] [PATCHv2 3/4] batman-adv: Handle parent interfaces in a different netns Andrew Lunn
2016-03-04 12:35   ` Sven Eckelmann
2016-03-07 14:31     ` Andrew Lunn
2016-03-07 14:45       ` Sven Eckelmann [this message]
2016-03-11 23:37       ` Sven Eckelmann
2016-03-12  4:42         ` Antonio Quartulli
2016-03-12  7:34           ` Sven Eckelmann
2016-03-12  7:40             ` Sven Eckelmann
2016-03-07  4:21   ` Linus Lüssing
2016-03-07 13:47     ` Andrew Lunn
2016-03-13 11:02   ` Sven Eckelmann
2016-03-13 15:38     ` Andrew Lunn
2016-03-13 15:59       ` Sven Eckelmann
2016-03-01 21:19 ` [B.A.T.M.A.N.] [PATCHv2 4/4] batman-adv: debugfs: Add netns support Andrew Lunn
2016-03-07 14:21   ` Matthias Schiffer
2016-03-13  9:12     ` Sven Eckelmann
2016-03-13 15:42       ` Andrew Lunn
2016-04-18 14:41         ` Simon Wunderlich
2016-04-20  2:36           ` Andrew Lunn
2016-04-20  3:23             ` Antonio Quartulli
2016-04-20  7:02             ` Sven Eckelmann
2016-03-14 10:41       ` Matthias Schiffer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2628096.3OTlO1qax0@bentobox \
    --to=sven@narfation.org \
    --cc=a@unstable.cc \
    --cc=andrew@lunn.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox