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

From
Ben Greear <hidden>
Date
2012-12-30 18:02:29
Reply to
Jiri Pirko, 2012-12-30
On 12/30/2012 03:58 AM, Jiri Pirko wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
  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 [off-list ref]
Candela Technologies Inc  http://www.candelatech.com
Thread (25 messages) 25 messages, 4 authors, last reply 2013-01-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help