aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/devinet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r--net/ipv4/devinet.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5281314886c1..f678507bc829 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -139,10 +139,9 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
139 u32 hash = inet_addr_hash(net, addr); 139 u32 hash = inet_addr_hash(net, addr);
140 struct net_device *result = NULL; 140 struct net_device *result = NULL;
141 struct in_ifaddr *ifa; 141 struct in_ifaddr *ifa;
142 struct hlist_node *node;
143 142
144 rcu_read_lock(); 143 rcu_read_lock();
145 hlist_for_each_entry_rcu(ifa, node, &inet_addr_lst[hash], hash) { 144 hlist_for_each_entry_rcu(ifa, &inet_addr_lst[hash], hash) {
146 if (ifa->ifa_local == addr) { 145 if (ifa->ifa_local == addr) {
147 struct net_device *dev = ifa->ifa_dev->dev; 146 struct net_device *dev = ifa->ifa_dev->dev;
148 147
@@ -588,7 +587,6 @@ static void check_lifetime(struct work_struct *work)
588{ 587{
589 unsigned long now, next, next_sec, next_sched; 588 unsigned long now, next, next_sec, next_sched;
590 struct in_ifaddr *ifa; 589 struct in_ifaddr *ifa;
591 struct hlist_node *node;
592 int i; 590 int i;
593 591
594 now = jiffies; 592 now = jiffies;
@@ -596,8 +594,7 @@ static void check_lifetime(struct work_struct *work)
596 594
597 rcu_read_lock(); 595 rcu_read_lock();
598 for (i = 0; i < IN4_ADDR_HSIZE; i++) { 596 for (i = 0; i < IN4_ADDR_HSIZE; i++) {
599 hlist_for_each_entry_rcu(ifa, node, 597 hlist_for_each_entry_rcu(ifa, &inet_addr_lst[i], hash) {
600 &inet_addr_lst[i], hash) {
601 unsigned long age; 598 unsigned long age;
602 599
603 if (ifa->ifa_flags & IFA_F_PERMANENT) 600 if (ifa->ifa_flags & IFA_F_PERMANENT)
@@ -1493,7 +1490,6 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
1493 struct in_device *in_dev; 1490 struct in_device *in_dev;
1494 struct in_ifaddr *ifa; 1491 struct in_ifaddr *ifa;
1495 struct hlist_head *head; 1492 struct hlist_head *head;
1496 struct hlist_node *node;
1497 1493
1498 s_h = cb->args[0]; 1494 s_h = cb->args[0];
1499 s_idx = idx = cb->args[1]; 1495 s_idx = idx = cb->args[1];
@@ -1503,7 +1499,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
1503 idx = 0; 1499 idx = 0;
1504 head = &net->dev_index_head[h]; 1500 head = &net->dev_index_head[h];
1505 rcu_read_lock(); 1501 rcu_read_lock();
1506 hlist_for_each_entry_rcu(dev, node, head, index_hlist) { 1502 hlist_for_each_entry_rcu(dev, head, index_hlist) {
1507 if (idx < s_idx) 1503 if (idx < s_idx)
1508 goto cont; 1504 goto cont;
1509 if (h > s_h || idx > s_idx) 1505 if (h > s_h || idx > s_idx)