aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 10:55:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 10:55:01 -0500
commitd7fc02c7bae7b1cf69269992cf880a43a350cdaa (patch)
treea43d56fa72913a1cc98a0bbebe054d08581b3a7c /net/rose
parentee1262dbc65ce0b6234a915d8432171e8d77f518 (diff)
parent28b4d5cc17c20786848cdc07b7ea237a309776bb (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1815 commits) mac80211: fix reorder buffer release iwmc3200wifi: Enable wimax core through module parameter iwmc3200wifi: Add wifi-wimax coexistence mode as a module parameter iwmc3200wifi: Coex table command does not expect a response iwmc3200wifi: Update wiwi priority table iwlwifi: driver version track kernel version iwlwifi: indicate uCode type when fail dump error/event log iwl3945: remove duplicated event logging code b43: fix two warnings ipw2100: fix rebooting hang with driver loaded cfg80211: indent regulatory messages with spaces iwmc3200wifi: fix NULL pointer dereference in pmkid update mac80211: Fix TX status reporting for injected data frames ath9k: enable 2GHz band only if the device supports it airo: Fix integer overflow warning rt2x00: Fix padding bug on L2PAD devices. WE: Fix set events not propagated b43legacy: avoid PPC fault during resume b43: avoid PPC fault during resume tcp: fix a timewait refcnt race ... Fix up conflicts due to sysctl cleanups (dead sysctl_check code and CTL_UNNUMBERED removed) in kernel/sysctl_check.c net/ipv4/sysctl_net_ipv4.c net/ipv6/addrconf.c net/sctp/sysctl.c
Diffstat (limited to 'net/rose')
-rw-r--r--net/rose/af_rose.c7
-rw-r--r--net/rose/rose_route.c28
2 files changed, 19 insertions, 16 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 502cce76621d..8feb9e5d6623 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -512,12 +512,13 @@ static struct proto rose_proto = {
512 .obj_size = sizeof(struct rose_sock), 512 .obj_size = sizeof(struct rose_sock),
513}; 513};
514 514
515static int rose_create(struct net *net, struct socket *sock, int protocol) 515static int rose_create(struct net *net, struct socket *sock, int protocol,
516 int kern)
516{ 517{
517 struct sock *sk; 518 struct sock *sk;
518 struct rose_sock *rose; 519 struct rose_sock *rose;
519 520
520 if (net != &init_net) 521 if (!net_eq(net, &init_net))
521 return -EAFNOSUPPORT; 522 return -EAFNOSUPPORT;
522 523
523 if (sock->type != SOCK_SEQPACKET || protocol != 0) 524 if (sock->type != SOCK_SEQPACKET || protocol != 0)
@@ -1509,7 +1510,7 @@ static const struct file_operations rose_info_fops = {
1509}; 1510};
1510#endif /* CONFIG_PROC_FS */ 1511#endif /* CONFIG_PROC_FS */
1511 1512
1512static struct net_proto_family rose_family_ops = { 1513static const struct net_proto_family rose_family_ops = {
1513 .family = PF_ROSE, 1514 .family = PF_ROSE,
1514 .create = rose_create, 1515 .create = rose_create,
1515 .owner = THIS_MODULE, 1516 .owner = THIS_MODULE,
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index f3e21989b88c..795c4b025e31 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -77,8 +77,9 @@ static int __must_check rose_add_node(struct rose_route_struct *rose_route,
77 77
78 rose_neigh = rose_neigh_list; 78 rose_neigh = rose_neigh_list;
79 while (rose_neigh != NULL) { 79 while (rose_neigh != NULL) {
80 if (ax25cmp(&rose_route->neighbour, &rose_neigh->callsign) == 0 80 if (ax25cmp(&rose_route->neighbour,
81 && rose_neigh->dev == dev) 81 &rose_neigh->callsign) == 0 &&
82 rose_neigh->dev == dev)
82 break; 83 break;
83 rose_neigh = rose_neigh->next; 84 rose_neigh = rose_neigh->next;
84 } 85 }
@@ -311,8 +312,9 @@ static int rose_del_node(struct rose_route_struct *rose_route,
311 312
312 rose_neigh = rose_neigh_list; 313 rose_neigh = rose_neigh_list;
313 while (rose_neigh != NULL) { 314 while (rose_neigh != NULL) {
314 if (ax25cmp(&rose_route->neighbour, &rose_neigh->callsign) == 0 315 if (ax25cmp(&rose_route->neighbour,
315 && rose_neigh->dev == dev) 316 &rose_neigh->callsign) == 0 &&
317 rose_neigh->dev == dev)
316 break; 318 break;
317 rose_neigh = rose_neigh->next; 319 rose_neigh = rose_neigh->next;
318 } 320 }
@@ -600,13 +602,13 @@ struct net_device *rose_dev_first(void)
600{ 602{
601 struct net_device *dev, *first = NULL; 603 struct net_device *dev, *first = NULL;
602 604
603 read_lock(&dev_base_lock); 605 rcu_read_lock();
604 for_each_netdev(&init_net, dev) { 606 for_each_netdev_rcu(&init_net, dev) {
605 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE) 607 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE)
606 if (first == NULL || strncmp(dev->name, first->name, 3) < 0) 608 if (first == NULL || strncmp(dev->name, first->name, 3) < 0)
607 first = dev; 609 first = dev;
608 } 610 }
609 read_unlock(&dev_base_lock); 611 rcu_read_unlock();
610 612
611 return first; 613 return first;
612} 614}
@@ -618,8 +620,8 @@ struct net_device *rose_dev_get(rose_address *addr)
618{ 620{
619 struct net_device *dev; 621 struct net_device *dev;
620 622
621 read_lock(&dev_base_lock); 623 rcu_read_lock();
622 for_each_netdev(&init_net, dev) { 624 for_each_netdev_rcu(&init_net, dev) {
623 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0) { 625 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0) {
624 dev_hold(dev); 626 dev_hold(dev);
625 goto out; 627 goto out;
@@ -627,7 +629,7 @@ struct net_device *rose_dev_get(rose_address *addr)
627 } 629 }
628 dev = NULL; 630 dev = NULL;
629out: 631out:
630 read_unlock(&dev_base_lock); 632 rcu_read_unlock();
631 return dev; 633 return dev;
632} 634}
633 635
@@ -635,14 +637,14 @@ static int rose_dev_exists(rose_address *addr)
635{ 637{
636 struct net_device *dev; 638 struct net_device *dev;
637 639
638 read_lock(&dev_base_lock); 640 rcu_read_lock();
639 for_each_netdev(&init_net, dev) { 641 for_each_netdev_rcu(&init_net, dev) {
640 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0) 642 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0)
641 goto out; 643 goto out;
642 } 644 }
643 dev = NULL; 645 dev = NULL;
644out: 646out:
645 read_unlock(&dev_base_lock); 647 rcu_read_unlock();
646 return dev != NULL; 648 return dev != NULL;
647} 649}
648 650