diff options
Diffstat (limited to 'net/rose/af_rose.c')
| -rw-r--r-- | net/rose/af_rose.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index c4719ce604c2..cf68e6e4054a 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
| @@ -165,10 +165,9 @@ static void rose_remove_socket(struct sock *sk) | |||
| 165 | void rose_kill_by_neigh(struct rose_neigh *neigh) | 165 | void rose_kill_by_neigh(struct rose_neigh *neigh) |
| 166 | { | 166 | { |
| 167 | struct sock *s; | 167 | struct sock *s; |
| 168 | struct hlist_node *node; | ||
| 169 | 168 | ||
| 170 | spin_lock_bh(&rose_list_lock); | 169 | spin_lock_bh(&rose_list_lock); |
| 171 | sk_for_each(s, node, &rose_list) { | 170 | sk_for_each(s, &rose_list) { |
| 172 | struct rose_sock *rose = rose_sk(s); | 171 | struct rose_sock *rose = rose_sk(s); |
| 173 | 172 | ||
| 174 | if (rose->neighbour == neigh) { | 173 | if (rose->neighbour == neigh) { |
| @@ -186,10 +185,9 @@ void rose_kill_by_neigh(struct rose_neigh *neigh) | |||
| 186 | static void rose_kill_by_device(struct net_device *dev) | 185 | static void rose_kill_by_device(struct net_device *dev) |
| 187 | { | 186 | { |
| 188 | struct sock *s; | 187 | struct sock *s; |
| 189 | struct hlist_node *node; | ||
| 190 | 188 | ||
| 191 | spin_lock_bh(&rose_list_lock); | 189 | spin_lock_bh(&rose_list_lock); |
| 192 | sk_for_each(s, node, &rose_list) { | 190 | sk_for_each(s, &rose_list) { |
| 193 | struct rose_sock *rose = rose_sk(s); | 191 | struct rose_sock *rose = rose_sk(s); |
| 194 | 192 | ||
| 195 | if (rose->device == dev) { | 193 | if (rose->device == dev) { |
| @@ -246,10 +244,9 @@ static void rose_insert_socket(struct sock *sk) | |||
| 246 | static struct sock *rose_find_listener(rose_address *addr, ax25_address *call) | 244 | static struct sock *rose_find_listener(rose_address *addr, ax25_address *call) |
| 247 | { | 245 | { |
| 248 | struct sock *s; | 246 | struct sock *s; |
| 249 | struct hlist_node *node; | ||
| 250 | 247 | ||
| 251 | spin_lock_bh(&rose_list_lock); | 248 | spin_lock_bh(&rose_list_lock); |
| 252 | sk_for_each(s, node, &rose_list) { | 249 | sk_for_each(s, &rose_list) { |
| 253 | struct rose_sock *rose = rose_sk(s); | 250 | struct rose_sock *rose = rose_sk(s); |
| 254 | 251 | ||
| 255 | if (!rosecmp(&rose->source_addr, addr) && | 252 | if (!rosecmp(&rose->source_addr, addr) && |
| @@ -258,7 +255,7 @@ static struct sock *rose_find_listener(rose_address *addr, ax25_address *call) | |||
| 258 | goto found; | 255 | goto found; |
| 259 | } | 256 | } |
| 260 | 257 | ||
| 261 | sk_for_each(s, node, &rose_list) { | 258 | sk_for_each(s, &rose_list) { |
| 262 | struct rose_sock *rose = rose_sk(s); | 259 | struct rose_sock *rose = rose_sk(s); |
| 263 | 260 | ||
| 264 | if (!rosecmp(&rose->source_addr, addr) && | 261 | if (!rosecmp(&rose->source_addr, addr) && |
| @@ -278,10 +275,9 @@ found: | |||
| 278 | struct sock *rose_find_socket(unsigned int lci, struct rose_neigh *neigh) | 275 | struct sock *rose_find_socket(unsigned int lci, struct rose_neigh *neigh) |
| 279 | { | 276 | { |
| 280 | struct sock *s; | 277 | struct sock *s; |
| 281 | struct hlist_node *node; | ||
| 282 | 278 | ||
| 283 | spin_lock_bh(&rose_list_lock); | 279 | spin_lock_bh(&rose_list_lock); |
| 284 | sk_for_each(s, node, &rose_list) { | 280 | sk_for_each(s, &rose_list) { |
| 285 | struct rose_sock *rose = rose_sk(s); | 281 | struct rose_sock *rose = rose_sk(s); |
| 286 | 282 | ||
| 287 | if (rose->lci == lci && rose->neighbour == neigh) | 283 | if (rose->lci == lci && rose->neighbour == neigh) |
| @@ -1575,10 +1571,13 @@ static int __init rose_proto_init(void) | |||
| 1575 | 1571 | ||
| 1576 | rose_add_loopback_neigh(); | 1572 | rose_add_loopback_neigh(); |
| 1577 | 1573 | ||
| 1578 | proc_net_fops_create(&init_net, "rose", S_IRUGO, &rose_info_fops); | 1574 | proc_create("rose", S_IRUGO, init_net.proc_net, &rose_info_fops); |
| 1579 | proc_net_fops_create(&init_net, "rose_neigh", S_IRUGO, &rose_neigh_fops); | 1575 | proc_create("rose_neigh", S_IRUGO, init_net.proc_net, |
| 1580 | proc_net_fops_create(&init_net, "rose_nodes", S_IRUGO, &rose_nodes_fops); | 1576 | &rose_neigh_fops); |
| 1581 | proc_net_fops_create(&init_net, "rose_routes", S_IRUGO, &rose_routes_fops); | 1577 | proc_create("rose_nodes", S_IRUGO, init_net.proc_net, |
| 1578 | &rose_nodes_fops); | ||
| 1579 | proc_create("rose_routes", S_IRUGO, init_net.proc_net, | ||
| 1580 | &rose_routes_fops); | ||
| 1582 | out: | 1581 | out: |
| 1583 | return rc; | 1582 | return rc; |
| 1584 | fail: | 1583 | fail: |
| @@ -1605,10 +1604,10 @@ static void __exit rose_exit(void) | |||
| 1605 | { | 1604 | { |
| 1606 | int i; | 1605 | int i; |
| 1607 | 1606 | ||
| 1608 | proc_net_remove(&init_net, "rose"); | 1607 | remove_proc_entry("rose", init_net.proc_net); |
| 1609 | proc_net_remove(&init_net, "rose_neigh"); | 1608 | remove_proc_entry("rose_neigh", init_net.proc_net); |
| 1610 | proc_net_remove(&init_net, "rose_nodes"); | 1609 | remove_proc_entry("rose_nodes", init_net.proc_net); |
| 1611 | proc_net_remove(&init_net, "rose_routes"); | 1610 | remove_proc_entry("rose_routes", init_net.proc_net); |
| 1612 | rose_loopback_clear(); | 1611 | rose_loopback_clear(); |
| 1613 | 1612 | ||
| 1614 | rose_rt_free(); | 1613 | rose_rt_free(); |
