diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 22:36:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 22:36:58 -0400 |
commit | 7e20ef030dde0e52dd5a57220ee82fa9facbea4e (patch) | |
tree | 5006db4f85a2d7be2777748aaff2966e79dddc6f /net/ipv4/devinet.c | |
parent | a3d52136ee8f7399859f9a0824470fd49b1d1a00 (diff) | |
parent | 07d939677166cc4f000c767196872a9becc2697b (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (49 commits)
[SCTP]: Set assoc_id correctly during INIT collision.
[SCTP]: Re-order SCTP initializations to avoid race with sctp_rcv()
[SCTP]: Fix the SO_REUSEADDR handling to be similar to TCP.
[SCTP]: Verify all destination ports in sctp_connectx.
[XFRM] SPD info TLV aggregation
[XFRM] SAD info TLV aggregationx
[AF_RXRPC]: Sort out MTU handling.
[AF_IUCV/IUCV] : Add missing section annotations
[AF_IUCV]: Implementation of a skb backlog queue
[NETLINK]: Remove bogus BUG_ON
[IPV6]: Some cleanups in include/net/ipv6.h
[TCP]: zero out rx_opt in tcp_disconnect()
[BNX2]: Fix TSO problem with small MSS.
[NET]: Rework dev_base via list_head (v3)
[TCP] Highspeed: Limited slow-start is nowadays in tcp_slow_start
[BNX2]: Update version and reldate.
[BNX2]: Print bus information for PCIE devices.
[BNX2]: Add 1-shot MSI handler for 5709.
[BNX2]: Restructure PHY event handling.
[BNX2]: Add indirect spinlock.
...
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 088888db8b3d..7f95e6e9beeb 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -910,7 +910,7 @@ no_in_dev: | |||
910 | */ | 910 | */ |
911 | read_lock(&dev_base_lock); | 911 | read_lock(&dev_base_lock); |
912 | rcu_read_lock(); | 912 | rcu_read_lock(); |
913 | for (dev = dev_base; dev; dev = dev->next) { | 913 | for_each_netdev(dev) { |
914 | if ((in_dev = __in_dev_get_rcu(dev)) == NULL) | 914 | if ((in_dev = __in_dev_get_rcu(dev)) == NULL) |
915 | continue; | 915 | continue; |
916 | 916 | ||
@@ -989,7 +989,7 @@ __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, | |||
989 | 989 | ||
990 | read_lock(&dev_base_lock); | 990 | read_lock(&dev_base_lock); |
991 | rcu_read_lock(); | 991 | rcu_read_lock(); |
992 | for (dev = dev_base; dev; dev = dev->next) { | 992 | for_each_netdev(dev) { |
993 | if ((in_dev = __in_dev_get_rcu(dev))) { | 993 | if ((in_dev = __in_dev_get_rcu(dev))) { |
994 | addr = confirm_addr_indev(in_dev, dst, local, scope); | 994 | addr = confirm_addr_indev(in_dev, dst, local, scope); |
995 | if (addr) | 995 | if (addr) |
@@ -1182,23 +1182,26 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) | |||
1182 | int s_ip_idx, s_idx = cb->args[0]; | 1182 | int s_ip_idx, s_idx = cb->args[0]; |
1183 | 1183 | ||
1184 | s_ip_idx = ip_idx = cb->args[1]; | 1184 | s_ip_idx = ip_idx = cb->args[1]; |
1185 | for (dev = dev_base, idx = 0; dev; dev = dev->next, idx++) { | 1185 | idx = 0; |
1186 | for_each_netdev(dev) { | ||
1186 | if (idx < s_idx) | 1187 | if (idx < s_idx) |
1187 | continue; | 1188 | goto cont; |
1188 | if (idx > s_idx) | 1189 | if (idx > s_idx) |
1189 | s_ip_idx = 0; | 1190 | s_ip_idx = 0; |
1190 | if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) | 1191 | if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) |
1191 | continue; | 1192 | goto cont; |
1192 | 1193 | ||
1193 | for (ifa = in_dev->ifa_list, ip_idx = 0; ifa; | 1194 | for (ifa = in_dev->ifa_list, ip_idx = 0; ifa; |
1194 | ifa = ifa->ifa_next, ip_idx++) { | 1195 | ifa = ifa->ifa_next, ip_idx++) { |
1195 | if (ip_idx < s_ip_idx) | 1196 | if (ip_idx < s_ip_idx) |
1196 | continue; | 1197 | goto cont; |
1197 | if (inet_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, | 1198 | if (inet_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid, |
1198 | cb->nlh->nlmsg_seq, | 1199 | cb->nlh->nlmsg_seq, |
1199 | RTM_NEWADDR, NLM_F_MULTI) <= 0) | 1200 | RTM_NEWADDR, NLM_F_MULTI) <= 0) |
1200 | goto done; | 1201 | goto done; |
1201 | } | 1202 | } |
1203 | cont: | ||
1204 | idx++; | ||
1202 | } | 1205 | } |
1203 | 1206 | ||
1204 | done: | 1207 | done: |
@@ -1243,7 +1246,7 @@ void inet_forward_change(void) | |||
1243 | ipv4_devconf_dflt.forwarding = on; | 1246 | ipv4_devconf_dflt.forwarding = on; |
1244 | 1247 | ||
1245 | read_lock(&dev_base_lock); | 1248 | read_lock(&dev_base_lock); |
1246 | for (dev = dev_base; dev; dev = dev->next) { | 1249 | for_each_netdev(dev) { |
1247 | struct in_device *in_dev; | 1250 | struct in_device *in_dev; |
1248 | rcu_read_lock(); | 1251 | rcu_read_lock(); |
1249 | in_dev = __in_dev_get_rcu(dev); | 1252 | in_dev = __in_dev_get_rcu(dev); |