Subject: Re: [RFC] bridge: partial rtnetlink hooks

From: Patrick McHardy <[email-masked]>
Date: Thu, 27 Apr 2006 10:24:18 +0200

Stephen Hemminger wrote:
> This is the start of adding support for rtnetlink to the bridge code.
> So far it only supports accessing the list of links and notifying
> about link changes. It is just a prototype to get early feedback, don't
> use to build your own masterpiece yet.
> 

> +static int br_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
> +{
> +	struct net_device *dev;
> +	int idx = 0;
> +	int err = 0;
> +
> +	printk(KERN_DEBUG "bridge dump ifinfo\n");
> +	for (dev = dev_base; dev; dev = dev->next) {
> +		struct net_bridge_port *p = rcu_dereference(dev->br_port);

I think using rcu_dereference (especially without rcu_read_lock()) is
a bit misleading, the pointer is actually protected by the RTNL at
this point.