patch-2.3.4 linux/net/core/rtnetlink.c

Next file: linux/net/core/skbuff.c
Previous file: linux/net/core/dst.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.3/linux/net/core/rtnetlink.c linux/net/core/rtnetlink.c
@@ -189,12 +189,14 @@
 	int s_idx = cb->args[0];
 	struct device *dev;
 
+	read_lock_bh(&dev_base_lock);
 	for (dev=dev_base, idx=0; dev; dev = dev->next, idx++) {
 		if (idx < s_idx)
 			continue;
 		if (rtnetlink_fill_ifinfo(skb, dev, RTM_NEWLINK, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq) <= 0)
 			break;
 	}
+	read_unlock_bh(&dev_base_lock);
 	cb->args[0] = idx;
 
 	return skb->len;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)