diff options
Diffstat (limited to 'net/rose/af_rose.c')
-rw-r--r-- | net/rose/af_rose.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 1ebf65294405..dbc963b4f5fb 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -75,6 +75,18 @@ ax25_address rose_callsign; | |||
75 | */ | 75 | */ |
76 | static struct lock_class_key rose_netdev_xmit_lock_key; | 76 | static struct lock_class_key rose_netdev_xmit_lock_key; |
77 | 77 | ||
78 | static void rose_set_lockdep_one(struct net_device *dev, | ||
79 | struct netdev_queue *txq, | ||
80 | void *_unused) | ||
81 | { | ||
82 | lockdep_set_class(&txq->_xmit_lock, &rose_netdev_xmit_lock_key); | ||
83 | } | ||
84 | |||
85 | static void rose_set_lockdep_key(struct net_device *dev) | ||
86 | { | ||
87 | netdev_for_each_tx_queue(dev, rose_set_lockdep_one, NULL); | ||
88 | } | ||
89 | |||
78 | /* | 90 | /* |
79 | * Convert a ROSE address into text. | 91 | * Convert a ROSE address into text. |
80 | */ | 92 | */ |
@@ -197,7 +209,7 @@ static int rose_device_event(struct notifier_block *this, unsigned long event, | |||
197 | { | 209 | { |
198 | struct net_device *dev = (struct net_device *)ptr; | 210 | struct net_device *dev = (struct net_device *)ptr; |
199 | 211 | ||
200 | if (dev_net(dev) != &init_net) | 212 | if (!net_eq(dev_net(dev), &init_net)) |
201 | return NOTIFY_DONE; | 213 | return NOTIFY_DONE; |
202 | 214 | ||
203 | if (event != NETDEV_DOWN) | 215 | if (event != NETDEV_DOWN) |
@@ -566,13 +578,11 @@ static struct sock *rose_make_new(struct sock *osk) | |||
566 | #endif | 578 | #endif |
567 | 579 | ||
568 | sk->sk_type = osk->sk_type; | 580 | sk->sk_type = osk->sk_type; |
569 | sk->sk_socket = osk->sk_socket; | ||
570 | sk->sk_priority = osk->sk_priority; | 581 | sk->sk_priority = osk->sk_priority; |
571 | sk->sk_protocol = osk->sk_protocol; | 582 | sk->sk_protocol = osk->sk_protocol; |
572 | sk->sk_rcvbuf = osk->sk_rcvbuf; | 583 | sk->sk_rcvbuf = osk->sk_rcvbuf; |
573 | sk->sk_sndbuf = osk->sk_sndbuf; | 584 | sk->sk_sndbuf = osk->sk_sndbuf; |
574 | sk->sk_state = TCP_ESTABLISHED; | 585 | sk->sk_state = TCP_ESTABLISHED; |
575 | sk->sk_sleep = osk->sk_sleep; | ||
576 | sock_copy_flags(sk, osk); | 586 | sock_copy_flags(sk, osk); |
577 | 587 | ||
578 | init_timer(&rose->timer); | 588 | init_timer(&rose->timer); |
@@ -759,7 +769,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le | |||
759 | sock->state = SS_UNCONNECTED; | 769 | sock->state = SS_UNCONNECTED; |
760 | 770 | ||
761 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, | 771 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, |
762 | &diagnostic); | 772 | &diagnostic, 0); |
763 | if (!rose->neighbour) { | 773 | if (!rose->neighbour) { |
764 | err = -ENETUNREACH; | 774 | err = -ENETUNREACH; |
765 | goto out_release; | 775 | goto out_release; |
@@ -855,7 +865,7 @@ rose_try_next_neigh: | |||
855 | 865 | ||
856 | if (sk->sk_state != TCP_ESTABLISHED) { | 866 | if (sk->sk_state != TCP_ESTABLISHED) { |
857 | /* Try next neighbour */ | 867 | /* Try next neighbour */ |
858 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic); | 868 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic, 0); |
859 | if (rose->neighbour) | 869 | if (rose->neighbour) |
860 | goto rose_try_next_neigh; | 870 | goto rose_try_next_neigh; |
861 | 871 | ||
@@ -924,14 +934,12 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags) | |||
924 | goto out_release; | 934 | goto out_release; |
925 | 935 | ||
926 | newsk = skb->sk; | 936 | newsk = skb->sk; |
927 | newsk->sk_socket = newsock; | 937 | sock_graft(newsk, newsock); |
928 | newsk->sk_sleep = &newsock->wait; | ||
929 | 938 | ||
930 | /* Now attach up the new socket */ | 939 | /* Now attach up the new socket */ |
931 | skb->sk = NULL; | 940 | skb->sk = NULL; |
932 | kfree_skb(skb); | 941 | kfree_skb(skb); |
933 | sk->sk_ack_backlog--; | 942 | sk->sk_ack_backlog--; |
934 | newsock->sk = newsk; | ||
935 | 943 | ||
936 | out_release: | 944 | out_release: |
937 | release_sock(sk); | 945 | release_sock(sk); |
@@ -1580,7 +1588,7 @@ static int __init rose_proto_init(void) | |||
1580 | free_netdev(dev); | 1588 | free_netdev(dev); |
1581 | goto fail; | 1589 | goto fail; |
1582 | } | 1590 | } |
1583 | lockdep_set_class(&dev->_xmit_lock, &rose_netdev_xmit_lock_key); | 1591 | rose_set_lockdep_key(dev); |
1584 | dev_rose[i] = dev; | 1592 | dev_rose[i] = dev; |
1585 | } | 1593 | } |
1586 | 1594 | ||