aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/neighbour.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2007-02-09 09:24:36 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-11 02:19:25 -0500
commit4ec93edb14fe5fdee9fae6335f2cbba204627eac (patch)
treeb768f96942b5d19f5bc36b47262c42a8a7acdd7f /net/core/neighbour.c
parent9d6f229fc45b6ac268020c0c8eff29e94bb34381 (diff)
[NET] CORE: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r--net/core/neighbour.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 054d46493d2b..c5f161e7957b 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -345,7 +345,7 @@ struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey,
345 struct neighbour *n; 345 struct neighbour *n;
346 int key_len = tbl->key_len; 346 int key_len = tbl->key_len;
347 u32 hash_val = tbl->hash(pkey, dev); 347 u32 hash_val = tbl->hash(pkey, dev);
348 348
349 NEIGH_CACHE_STAT_INC(tbl, lookups); 349 NEIGH_CACHE_STAT_INC(tbl, lookups);
350 350
351 read_lock_bh(&tbl->lock); 351 read_lock_bh(&tbl->lock);
@@ -687,9 +687,9 @@ next_elt:
687 np = &n->next; 687 np = &n->next;
688 } 688 }
689 689
690 /* Cycle through all hash buckets every base_reachable_time/2 ticks. 690 /* Cycle through all hash buckets every base_reachable_time/2 ticks.
691 * ARP entry timeouts range from 1/2 base_reachable_time to 3/2 691 * ARP entry timeouts range from 1/2 base_reachable_time to 3/2
692 * base_reachable_time. 692 * base_reachable_time.
693 */ 693 */
694 expire = tbl->parms.base_reachable_time >> 1; 694 expire = tbl->parms.base_reachable_time >> 1;
695 expire /= (tbl->hash_mask + 1); 695 expire /= (tbl->hash_mask + 1);
@@ -744,7 +744,7 @@ static void neigh_timer_handler(unsigned long arg)
744 } 744 }
745 745
746 if (state & NUD_REACHABLE) { 746 if (state & NUD_REACHABLE) {
747 if (time_before_eq(now, 747 if (time_before_eq(now,
748 neigh->confirmed + neigh->parms->reachable_time)) { 748 neigh->confirmed + neigh->parms->reachable_time)) {
749 NEIGH_PRINTK2("neigh %p is still alive.\n", neigh); 749 NEIGH_PRINTK2("neigh %p is still alive.\n", neigh);
750 next = neigh->confirmed + neigh->parms->reachable_time; 750 next = neigh->confirmed + neigh->parms->reachable_time;
@@ -763,7 +763,7 @@ static void neigh_timer_handler(unsigned long arg)
763 notify = 1; 763 notify = 1;
764 } 764 }
765 } else if (state & NUD_DELAY) { 765 } else if (state & NUD_DELAY) {
766 if (time_before_eq(now, 766 if (time_before_eq(now,
767 neigh->confirmed + neigh->parms->delay_probe_time)) { 767 neigh->confirmed + neigh->parms->delay_probe_time)) {
768 NEIGH_PRINTK2("neigh %p is now reachable.\n", neigh); 768 NEIGH_PRINTK2("neigh %p is now reachable.\n", neigh);
769 neigh->nud_state = NUD_REACHABLE; 769 neigh->nud_state = NUD_REACHABLE;
@@ -849,7 +849,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
849 goto out_unlock_bh; 849 goto out_unlock_bh;
850 850
851 now = jiffies; 851 now = jiffies;
852 852
853 if (!(neigh->nud_state & (NUD_STALE | NUD_INCOMPLETE))) { 853 if (!(neigh->nud_state & (NUD_STALE | NUD_INCOMPLETE))) {
854 if (neigh->parms->mcast_probes + neigh->parms->app_probes) { 854 if (neigh->parms->mcast_probes + neigh->parms->app_probes) {
855 atomic_set(&neigh->probes, neigh->parms->ucast_probes); 855 atomic_set(&neigh->probes, neigh->parms->ucast_probes);
@@ -917,13 +917,13 @@ static void neigh_update_hhs(struct neighbour *neigh)
917 NEIGH_UPDATE_F_OVERRIDE allows to override existing lladdr, 917 NEIGH_UPDATE_F_OVERRIDE allows to override existing lladdr,
918 if it is different. 918 if it is different.
919 NEIGH_UPDATE_F_WEAK_OVERRIDE will suspect existing "connected" 919 NEIGH_UPDATE_F_WEAK_OVERRIDE will suspect existing "connected"
920 lladdr instead of overriding it 920 lladdr instead of overriding it
921 if it is different. 921 if it is different.
922 It also allows to retain current state 922 It also allows to retain current state
923 if lladdr is unchanged. 923 if lladdr is unchanged.
924 NEIGH_UPDATE_F_ADMIN means that the change is administrative. 924 NEIGH_UPDATE_F_ADMIN means that the change is administrative.
925 925
926 NEIGH_UPDATE_F_OVERRIDE_ISROUTER allows to override existing 926 NEIGH_UPDATE_F_OVERRIDE_ISROUTER allows to override existing
927 NTF_ROUTER flag. 927 NTF_ROUTER flag.
928 NEIGH_UPDATE_F_ISROUTER indicates if the neighbour is known as 928 NEIGH_UPDATE_F_ISROUTER indicates if the neighbour is known as
929 a router. 929 a router.
@@ -946,7 +946,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
946 old = neigh->nud_state; 946 old = neigh->nud_state;
947 err = -EPERM; 947 err = -EPERM;
948 948
949 if (!(flags & NEIGH_UPDATE_F_ADMIN) && 949 if (!(flags & NEIGH_UPDATE_F_ADMIN) &&
950 (old & (NUD_NOARP | NUD_PERMANENT))) 950 (old & (NUD_NOARP | NUD_PERMANENT)))
951 goto out; 951 goto out;
952 952
@@ -970,7 +970,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
970 - compare new & old 970 - compare new & old
971 - if they are different, check override flag 971 - if they are different, check override flag
972 */ 972 */
973 if ((old & NUD_VALID) && 973 if ((old & NUD_VALID) &&
974 !memcmp(lladdr, neigh->ha, dev->addr_len)) 974 !memcmp(lladdr, neigh->ha, dev->addr_len))
975 lladdr = neigh->ha; 975 lladdr = neigh->ha;
976 } else { 976 } else {
@@ -1014,8 +1014,8 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
1014 neigh_del_timer(neigh); 1014 neigh_del_timer(neigh);
1015 if (new & NUD_IN_TIMER) { 1015 if (new & NUD_IN_TIMER) {
1016 neigh_hold(neigh); 1016 neigh_hold(neigh);
1017 neigh_add_timer(neigh, (jiffies + 1017 neigh_add_timer(neigh, (jiffies +
1018 ((new & NUD_REACHABLE) ? 1018 ((new & NUD_REACHABLE) ?
1019 neigh->parms->reachable_time : 1019 neigh->parms->reachable_time :
1020 0))); 1020 0)));
1021 } 1021 }
@@ -1077,7 +1077,7 @@ struct neighbour *neigh_event_ns(struct neigh_table *tbl,
1077 struct neighbour *neigh = __neigh_lookup(tbl, saddr, dev, 1077 struct neighbour *neigh = __neigh_lookup(tbl, saddr, dev,
1078 lladdr || !dev->addr_len); 1078 lladdr || !dev->addr_len);
1079 if (neigh) 1079 if (neigh)
1080 neigh_update(neigh, lladdr, NUD_STALE, 1080 neigh_update(neigh, lladdr, NUD_STALE,
1081 NEIGH_UPDATE_F_OVERRIDE); 1081 NEIGH_UPDATE_F_OVERRIDE);
1082 return neigh; 1082 return neigh;
1083} 1083}
@@ -1129,7 +1129,7 @@ int neigh_compat_output(struct sk_buff *skb)
1129 1129
1130 if (dev->hard_header && 1130 if (dev->hard_header &&
1131 dev->hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL, 1131 dev->hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL,
1132 skb->len) < 0 && 1132 skb->len) < 0 &&
1133 dev->rebuild_header(skb)) 1133 dev->rebuild_header(skb))
1134 return 0; 1134 return 0;
1135 1135
@@ -1349,10 +1349,10 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
1349 tbl->stats = alloc_percpu(struct neigh_statistics); 1349 tbl->stats = alloc_percpu(struct neigh_statistics);
1350 if (!tbl->stats) 1350 if (!tbl->stats)
1351 panic("cannot create neighbour cache statistics"); 1351 panic("cannot create neighbour cache statistics");
1352 1352
1353#ifdef CONFIG_PROC_FS 1353#ifdef CONFIG_PROC_FS
1354 tbl->pde = create_proc_entry(tbl->id, 0, proc_net_stat); 1354 tbl->pde = create_proc_entry(tbl->id, 0, proc_net_stat);
1355 if (!tbl->pde) 1355 if (!tbl->pde)
1356 panic("cannot create neighbour proc dir entry"); 1356 panic("cannot create neighbour proc dir entry");
1357 tbl->pde->proc_fops = &neigh_stat_seq_fops; 1357 tbl->pde->proc_fops = &neigh_stat_seq_fops;
1358 tbl->pde->data = tbl; 1358 tbl->pde->data = tbl;
@@ -1567,7 +1567,7 @@ int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
1567 err = -ENOENT; 1567 err = -ENOENT;
1568 goto out_dev_put; 1568 goto out_dev_put;
1569 } 1569 }
1570 1570
1571 neigh = __neigh_lookup_errno(tbl, dst, dev); 1571 neigh = __neigh_lookup_errno(tbl, dst, dev);
1572 if (IS_ERR(neigh)) { 1572 if (IS_ERR(neigh)) {
1573 err = PTR_ERR(neigh); 1573 err = PTR_ERR(neigh);
@@ -1744,12 +1744,12 @@ errout:
1744 nlmsg_cancel(skb, nlh); 1744 nlmsg_cancel(skb, nlh);
1745 return -EMSGSIZE; 1745 return -EMSGSIZE;
1746} 1746}
1747 1747
1748static inline struct neigh_parms *lookup_neigh_params(struct neigh_table *tbl, 1748static inline struct neigh_parms *lookup_neigh_params(struct neigh_table *tbl,
1749 int ifindex) 1749 int ifindex)
1750{ 1750{
1751 struct neigh_parms *p; 1751 struct neigh_parms *p;
1752 1752
1753 for (p = &tbl->parms; p; p = p->next) 1753 for (p = &tbl->parms; p; p = p->next)
1754 if ((p->dev && p->dev->ifindex == ifindex) || 1754 if ((p->dev && p->dev->ifindex == ifindex) ||
1755 (!p->dev && !ifindex)) 1755 (!p->dev && !ifindex))
@@ -1815,7 +1815,7 @@ int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
1815 goto errout_locked; 1815 goto errout_locked;
1816 } 1816 }
1817 1817
1818 /* 1818 /*
1819 * We acquire tbl->lock to be nice to the periodic timers and 1819 * We acquire tbl->lock to be nice to the periodic timers and
1820 * make sure they always see a consistent set of values. 1820 * make sure they always see a consistent set of values.
1821 */ 1821 */
@@ -2323,7 +2323,7 @@ static void *neigh_stat_seq_start(struct seq_file *seq, loff_t *pos)
2323 2323
2324 if (*pos == 0) 2324 if (*pos == 0)
2325 return SEQ_START_TOKEN; 2325 return SEQ_START_TOKEN;
2326 2326
2327 for (cpu = *pos-1; cpu < NR_CPUS; ++cpu) { 2327 for (cpu = *pos-1; cpu < NR_CPUS; ++cpu) {
2328 if (!cpu_possible(cpu)) 2328 if (!cpu_possible(cpu))
2329 continue; 2329 continue;
@@ -2631,7 +2631,7 @@ static struct neigh_sysctl_table {
2631}; 2631};
2632 2632
2633int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, 2633int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2634 int p_id, int pdev_id, char *p_name, 2634 int p_id, int pdev_id, char *p_name,
2635 proc_handler *handler, ctl_handler *strategy) 2635 proc_handler *handler, ctl_handler *strategy)
2636{ 2636{
2637 struct neigh_sysctl_table *t = kmemdup(&neigh_sysctl_template, 2637 struct neigh_sysctl_table *t = kmemdup(&neigh_sysctl_template,
@@ -2663,7 +2663,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2663 t->neigh_vars[14].procname = NULL; 2663 t->neigh_vars[14].procname = NULL;
2664 t->neigh_vars[15].procname = NULL; 2664 t->neigh_vars[15].procname = NULL;
2665 } else { 2665 } else {
2666 dev_name_source = t->neigh_dev[0].procname; 2666 dev_name_source = t->neigh_dev[0].procname;
2667 t->neigh_vars[12].data = (int *)(p + 1); 2667 t->neigh_vars[12].data = (int *)(p + 1);
2668 t->neigh_vars[13].data = (int *)(p + 1) + 1; 2668 t->neigh_vars[13].data = (int *)(p + 1) + 1;
2669 t->neigh_vars[14].data = (int *)(p + 1) + 2; 2669 t->neigh_vars[14].data = (int *)(p + 1) + 2;
@@ -2698,7 +2698,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2698 goto free; 2698 goto free;
2699 } 2699 }
2700 2700
2701 t->neigh_dev[0].procname = dev_name; 2701 t->neigh_dev[0].procname = dev_name;
2702 2702
2703 t->neigh_neigh_dir[0].ctl_name = pdev_id; 2703 t->neigh_neigh_dir[0].ctl_name = pdev_id;
2704 2704