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

Antonio Quartulli
2016-01-25T03:28:53Z

On Wed, Jan 20, 2016 at 06:48:28PM +0100, Andrew Lunn wrote:
> int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
> - const char *iface_name)
> + struct net *net, const char *iface_name)

Andrew,
minor style note here: instead of passing the namespace as argument, could we
just invoke dev_net() on hard_iface->net_dev inside
batadv_hardif_enable_interface() ?

> {
> struct batadv_priv *bat_priv;
> struct net_device *soft_iface, *master;
> @@ -432,10 +433,10 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
> if (!atomic_inc_not_zero(&hard_iface->refcount))
> goto out;
>
> - soft_iface = dev_get_by_name(&init_net, iface_name);
> + soft_iface = dev_get_by_name(net, iface_name);
>
> if (!soft_iface) {
> - soft_iface = batadv_softif_create(iface_name);
> + soft_iface = batadv_softif_create(net, iface_name);
>
> if (!soft_iface) {
> ret = -ENOMEM;

--
Antonio Quartulli