Re: [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: Create batman soft interfaces within correct netns.

Sven Eckelmann
2016-01-31T13:26:33Z

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

On Wednesday 20 January 2016 18:48:28 Andrew Lunn wrote:
> When creating a soft interface, create it in the same netns as the
> hard interface. Replace all references to init_net with the correct
> name space for the interface being manipulated.
>
> Suggested-by: Daniel Ehlers <danielehlers@mindeye.net>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
> net/batman-adv/hard-interface.c | 9 +++++----
> net/batman-adv/hard-interface.h | 2 +-
> net/batman-adv/soft-interface.c | 7 +++++--
> net/batman-adv/soft-interface.h | 2 +-
> net/batman-adv/sysfs.c | 3 ++-
> net/batman-adv/translation-table.c | 3 ++-
> 6 files changed, 16 insertions(+), 10 deletions(-)

This patch doesn't apply (via git-am/git-apply; and only unclean with GNU
patch). Can you please rebase it.

[...]
> diff --git a/net/batman-adv/hard-interface.h
> b/net/batman-adv/hard-interface.h index 5a31420..4ed737f 100644
> --- a/net/batman-adv/hard-interface.h
> +++ b/net/batman-adv/hard-interface.h

New forward declaration missing:

struct net;

> @@ -55,7 +55,7 @@ bool batadv_is_wifi_iface(int ifindex);
> struct batadv_hard_iface*
> batadv_hardif_get_by_netdev(const struct net_device *net_dev);
> int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
> - const char *iface_name);
> + struct net *net, const char *iface_name);
> void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface,
> enum batadv_hard_if_cleanup autodel);
> void batadv_hardif_remove_interfaces(void);
[...]
> diff --git a/net/batman-adv/soft-interface.h
> b/net/batman-adv/soft-interface.h index 8e82176..d616cd5 100644
> --- a/net/batman-adv/soft-interface.h
> +++ b/net/batman-adv/soft-interface.h

New forward declaration missing:

struct net;

> @@ -29,7 +29,7 @@ int batadv_skb_head_push(struct sk_buff *skb, unsigned int
> len); void batadv_interface_rx(struct net_device *soft_iface,
> struct sk_buff *skb, struct batadv_hard_iface *recv_if,
> int hdr_size, struct batadv_orig_node *orig_node);
> -struct net_device *batadv_softif_create(const char *name);
> +struct net_device *batadv_softif_create(struct net *net, const char *name);
> void batadv_softif_destroy_sysfs(struct net_device *soft_iface);
> int batadv_softif_is_valid(const struct net_device *net_dev);
> extern struct rtnl_link_ops batadv_link_ops;
[...]
> diff --git a/net/batman-adv/translation-table.c
> b/net/batman-adv/translation-table.c index 76f19ba..0dbda83 100644
> --- a/net/batman-adv/translation-table.c
> +++ b/net/batman-adv/translation-table.c

init_net is not used anymore and thus following include should be removed:

#include <net/net_namespace.h>

Kind regards,
Sven

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