Subject: Re: [patch net-next 04/15] rtnetlink: remove usage of dev->master

From: Ben Greear <[email-masked]>
Date: Sun, 30 Dec 2012 10:00:55 -0800

On 12/30/2012 03:58 AM, Jiri Pirko wrote:
> Signed-off-by: Jiri Pirko <[email-masked]>
> ---
>   net/core/rtnetlink.c | 69 ++++++++++++++++++++++++++++------------------------
>   1 file changed, 37 insertions(+), 32 deletions(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 2ef7a56..ae612f4 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -880,6 +880,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
>   	const struct rtnl_link_stats64 *stats;
>   	struct nlattr *attr, *af_spec;
>   	struct rtnl_af_ops *af_ops;
> +	struct net_device *upper_dev = netdev_master_upper_dev_get(dev);
>
>   	ASSERT_RTNL();
>   	nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifm), flags);
> @@ -908,8 +909,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
>   #endif
>   	    (dev->ifindex != dev->iflink &&
>   	     nla_put_u32(skb, IFLA_LINK, dev->iflink)) ||
> -	    (dev->master &&
> -	     nla_put_u32(skb, IFLA_MASTER, dev->master->ifindex)) ||
> +	    (upper_dev &&
> +	     nla_put_u32(skb, IFLA_MASTER, upper_dev->ifindex)) ||

This seems confusing to me.  You are calling the new variable 'upper_dev',
but it seems you are actually using it as a lower_dev???

Thanks,
Ben

-- 
Ben Greear <[email-masked]>
Candela Technologies Inc  http://www.candelatech.com