diff options
Diffstat (limited to 'net')
40 files changed, 383 insertions, 198 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 26a646d4eb32..c9230c398697 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -554,6 +554,12 @@ static const struct net_device_ops br2684_netdev_ops = { | |||
554 | .ndo_validate_addr = eth_validate_addr, | 554 | .ndo_validate_addr = eth_validate_addr, |
555 | }; | 555 | }; |
556 | 556 | ||
557 | static const struct net_device_ops br2684_netdev_ops_routed = { | ||
558 | .ndo_start_xmit = br2684_start_xmit, | ||
559 | .ndo_set_mac_address = br2684_mac_addr, | ||
560 | .ndo_change_mtu = eth_change_mtu | ||
561 | }; | ||
562 | |||
557 | static void br2684_setup(struct net_device *netdev) | 563 | static void br2684_setup(struct net_device *netdev) |
558 | { | 564 | { |
559 | struct br2684_dev *brdev = BRPRIV(netdev); | 565 | struct br2684_dev *brdev = BRPRIV(netdev); |
@@ -569,11 +575,10 @@ static void br2684_setup(struct net_device *netdev) | |||
569 | static void br2684_setup_routed(struct net_device *netdev) | 575 | static void br2684_setup_routed(struct net_device *netdev) |
570 | { | 576 | { |
571 | struct br2684_dev *brdev = BRPRIV(netdev); | 577 | struct br2684_dev *brdev = BRPRIV(netdev); |
572 | brdev->net_dev = netdev; | ||
573 | 578 | ||
579 | brdev->net_dev = netdev; | ||
574 | netdev->hard_header_len = 0; | 580 | netdev->hard_header_len = 0; |
575 | 581 | netdev->netdev_ops = &br2684_netdev_ops_routed; | |
576 | netdev->netdev_ops = &br2684_netdev_ops; | ||
577 | netdev->addr_len = 0; | 582 | netdev->addr_len = 0; |
578 | netdev->mtu = 1500; | 583 | netdev->mtu = 1500; |
579 | netdev->type = ARPHRD_PPP; | 584 | netdev->type = ARPHRD_PPP; |
diff --git a/net/atm/lec.c b/net/atm/lec.c index b2d644560323..42749b7b917c 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -62,7 +62,6 @@ static int lec_open(struct net_device *dev); | |||
62 | static netdev_tx_t lec_start_xmit(struct sk_buff *skb, | 62 | static netdev_tx_t lec_start_xmit(struct sk_buff *skb, |
63 | struct net_device *dev); | 63 | struct net_device *dev); |
64 | static int lec_close(struct net_device *dev); | 64 | static int lec_close(struct net_device *dev); |
65 | static void lec_init(struct net_device *dev); | ||
66 | static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, | 65 | static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, |
67 | const unsigned char *mac_addr); | 66 | const unsigned char *mac_addr); |
68 | static int lec_arp_remove(struct lec_priv *priv, | 67 | static int lec_arp_remove(struct lec_priv *priv, |
@@ -670,13 +669,6 @@ static const struct net_device_ops lec_netdev_ops = { | |||
670 | .ndo_set_multicast_list = lec_set_multicast_list, | 669 | .ndo_set_multicast_list = lec_set_multicast_list, |
671 | }; | 670 | }; |
672 | 671 | ||
673 | |||
674 | static void lec_init(struct net_device *dev) | ||
675 | { | ||
676 | dev->netdev_ops = &lec_netdev_ops; | ||
677 | printk("%s: Initialized!\n", dev->name); | ||
678 | } | ||
679 | |||
680 | static const unsigned char lec_ctrl_magic[] = { | 672 | static const unsigned char lec_ctrl_magic[] = { |
681 | 0xff, | 673 | 0xff, |
682 | 0x00, | 674 | 0x00, |
@@ -893,6 +885,7 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) | |||
893 | dev_lec[i] = alloc_etherdev(size); | 885 | dev_lec[i] = alloc_etherdev(size); |
894 | if (!dev_lec[i]) | 886 | if (!dev_lec[i]) |
895 | return -ENOMEM; | 887 | return -ENOMEM; |
888 | dev_lec[i]->netdev_ops = &lec_netdev_ops; | ||
896 | snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i); | 889 | snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i); |
897 | if (register_netdev(dev_lec[i])) { | 890 | if (register_netdev(dev_lec[i])) { |
898 | free_netdev(dev_lec[i]); | 891 | free_netdev(dev_lec[i]); |
@@ -901,7 +894,6 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) | |||
901 | 894 | ||
902 | priv = netdev_priv(dev_lec[i]); | 895 | priv = netdev_priv(dev_lec[i]); |
903 | priv->is_trdev = is_trdev; | 896 | priv->is_trdev = is_trdev; |
904 | lec_init(dev_lec[i]); | ||
905 | } else { | 897 | } else { |
906 | priv = netdev_priv(dev_lec[i]); | 898 | priv = netdev_priv(dev_lec[i]); |
907 | if (priv->lecd) | 899 | if (priv->lecd) |
diff --git a/net/compat.c b/net/compat.c index e1a56ade803b..a1fb1b079a82 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -754,26 +754,21 @@ asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len, | |||
754 | 754 | ||
755 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | 755 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, |
756 | unsigned vlen, unsigned int flags, | 756 | unsigned vlen, unsigned int flags, |
757 | struct timespec __user *timeout) | 757 | struct compat_timespec __user *timeout) |
758 | { | 758 | { |
759 | int datagrams; | 759 | int datagrams; |
760 | struct timespec ktspec; | 760 | struct timespec ktspec; |
761 | struct compat_timespec __user *utspec; | ||
762 | 761 | ||
763 | if (timeout == NULL) | 762 | if (timeout == NULL) |
764 | return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, | 763 | return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, |
765 | flags | MSG_CMSG_COMPAT, NULL); | 764 | flags | MSG_CMSG_COMPAT, NULL); |
766 | 765 | ||
767 | utspec = (struct compat_timespec __user *)timeout; | 766 | if (get_compat_timespec(&ktspec, timeout)) |
768 | if (get_user(ktspec.tv_sec, &utspec->tv_sec) || | ||
769 | get_user(ktspec.tv_nsec, &utspec->tv_nsec)) | ||
770 | return -EFAULT; | 767 | return -EFAULT; |
771 | 768 | ||
772 | datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, | 769 | datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, |
773 | flags | MSG_CMSG_COMPAT, &ktspec); | 770 | flags | MSG_CMSG_COMPAT, &ktspec); |
774 | if (datagrams > 0 && | 771 | if (datagrams > 0 && put_compat_timespec(&ktspec, timeout)) |
775 | (put_user(ktspec.tv_sec, &utspec->tv_sec) || | ||
776 | put_user(ktspec.tv_nsec, &utspec->tv_nsec))) | ||
777 | datagrams = -EFAULT; | 772 | datagrams = -EFAULT; |
778 | 773 | ||
779 | return datagrams; | 774 | return datagrams; |
diff --git a/net/core/dev.c b/net/core/dev.c index c36a17aafcf3..6fe7d739e59b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4771,21 +4771,23 @@ static void net_set_todo(struct net_device *dev) | |||
4771 | 4771 | ||
4772 | static void rollback_registered_many(struct list_head *head) | 4772 | static void rollback_registered_many(struct list_head *head) |
4773 | { | 4773 | { |
4774 | struct net_device *dev; | 4774 | struct net_device *dev, *tmp; |
4775 | 4775 | ||
4776 | BUG_ON(dev_boot_phase); | 4776 | BUG_ON(dev_boot_phase); |
4777 | ASSERT_RTNL(); | 4777 | ASSERT_RTNL(); |
4778 | 4778 | ||
4779 | list_for_each_entry(dev, head, unreg_list) { | 4779 | list_for_each_entry_safe(dev, tmp, head, unreg_list) { |
4780 | /* Some devices call without registering | 4780 | /* Some devices call without registering |
4781 | * for initialization unwind. | 4781 | * for initialization unwind. Remove those |
4782 | * devices and proceed with the remaining. | ||
4782 | */ | 4783 | */ |
4783 | if (dev->reg_state == NETREG_UNINITIALIZED) { | 4784 | if (dev->reg_state == NETREG_UNINITIALIZED) { |
4784 | pr_debug("unregister_netdevice: device %s/%p never " | 4785 | pr_debug("unregister_netdevice: device %s/%p never " |
4785 | "was registered\n", dev->name, dev); | 4786 | "was registered\n", dev->name, dev); |
4786 | 4787 | ||
4787 | WARN_ON(1); | 4788 | WARN_ON(1); |
4788 | return; | 4789 | list_del(&dev->unreg_list); |
4790 | continue; | ||
4789 | } | 4791 | } |
4790 | 4792 | ||
4791 | BUG_ON(dev->reg_state != NETREG_REGISTERED); | 4793 | BUG_ON(dev->reg_state != NETREG_REGISTERED); |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index efbcfdc12796..dad7bc4878e0 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -408,7 +408,7 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
408 | 408 | ||
409 | dccp_sync_mss(newsk, dst_mtu(dst)); | 409 | dccp_sync_mss(newsk, dst_mtu(dst)); |
410 | 410 | ||
411 | __inet_hash_nolisten(newsk); | 411 | __inet_hash_nolisten(newsk, NULL); |
412 | __inet_inherit_port(sk, newsk); | 412 | __inet_inherit_port(sk, newsk); |
413 | 413 | ||
414 | return newsk; | 414 | return newsk; |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 6574215a1f51..baf05cf43c28 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -46,7 +46,7 @@ static void dccp_v6_hash(struct sock *sk) | |||
46 | return; | 46 | return; |
47 | } | 47 | } |
48 | local_bh_disable(); | 48 | local_bh_disable(); |
49 | __inet6_hash(sk); | 49 | __inet6_hash(sk, NULL); |
50 | local_bh_enable(); | 50 | local_bh_enable(); |
51 | } | 51 | } |
52 | } | 52 | } |
@@ -644,7 +644,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | |||
644 | newinet->inet_daddr = newinet->inet_saddr = LOOPBACK4_IPV6; | 644 | newinet->inet_daddr = newinet->inet_saddr = LOOPBACK4_IPV6; |
645 | newinet->inet_rcv_saddr = LOOPBACK4_IPV6; | 645 | newinet->inet_rcv_saddr = LOOPBACK4_IPV6; |
646 | 646 | ||
647 | __inet6_hash(newsk); | 647 | __inet6_hash(newsk, NULL); |
648 | __inet_inherit_port(sk, newsk); | 648 | __inet_inherit_port(sk, newsk); |
649 | 649 | ||
650 | return newsk; | 650 | return newsk; |
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 21e5e32d8c60..2b79377b468d 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c | |||
@@ -351,12 +351,13 @@ static inline u32 inet_sk_port_offset(const struct sock *sk) | |||
351 | inet->inet_dport); | 351 | inet->inet_dport); |
352 | } | 352 | } |
353 | 353 | ||
354 | void __inet_hash_nolisten(struct sock *sk) | 354 | int __inet_hash_nolisten(struct sock *sk, struct inet_timewait_sock *tw) |
355 | { | 355 | { |
356 | struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo; | 356 | struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo; |
357 | struct hlist_nulls_head *list; | 357 | struct hlist_nulls_head *list; |
358 | spinlock_t *lock; | 358 | spinlock_t *lock; |
359 | struct inet_ehash_bucket *head; | 359 | struct inet_ehash_bucket *head; |
360 | int twrefcnt = 0; | ||
360 | 361 | ||
361 | WARN_ON(!sk_unhashed(sk)); | 362 | WARN_ON(!sk_unhashed(sk)); |
362 | 363 | ||
@@ -367,8 +368,13 @@ void __inet_hash_nolisten(struct sock *sk) | |||
367 | 368 | ||
368 | spin_lock(lock); | 369 | spin_lock(lock); |
369 | __sk_nulls_add_node_rcu(sk, list); | 370 | __sk_nulls_add_node_rcu(sk, list); |
371 | if (tw) { | ||
372 | WARN_ON(sk->sk_hash != tw->tw_hash); | ||
373 | twrefcnt = inet_twsk_unhash(tw); | ||
374 | } | ||
370 | spin_unlock(lock); | 375 | spin_unlock(lock); |
371 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); | 376 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); |
377 | return twrefcnt; | ||
372 | } | 378 | } |
373 | EXPORT_SYMBOL_GPL(__inet_hash_nolisten); | 379 | EXPORT_SYMBOL_GPL(__inet_hash_nolisten); |
374 | 380 | ||
@@ -378,7 +384,7 @@ static void __inet_hash(struct sock *sk) | |||
378 | struct inet_listen_hashbucket *ilb; | 384 | struct inet_listen_hashbucket *ilb; |
379 | 385 | ||
380 | if (sk->sk_state != TCP_LISTEN) { | 386 | if (sk->sk_state != TCP_LISTEN) { |
381 | __inet_hash_nolisten(sk); | 387 | __inet_hash_nolisten(sk, NULL); |
382 | return; | 388 | return; |
383 | } | 389 | } |
384 | 390 | ||
@@ -427,7 +433,7 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row, | |||
427 | struct sock *sk, u32 port_offset, | 433 | struct sock *sk, u32 port_offset, |
428 | int (*check_established)(struct inet_timewait_death_row *, | 434 | int (*check_established)(struct inet_timewait_death_row *, |
429 | struct sock *, __u16, struct inet_timewait_sock **), | 435 | struct sock *, __u16, struct inet_timewait_sock **), |
430 | void (*hash)(struct sock *sk)) | 436 | int (*hash)(struct sock *sk, struct inet_timewait_sock *twp)) |
431 | { | 437 | { |
432 | struct inet_hashinfo *hinfo = death_row->hashinfo; | 438 | struct inet_hashinfo *hinfo = death_row->hashinfo; |
433 | const unsigned short snum = inet_sk(sk)->inet_num; | 439 | const unsigned short snum = inet_sk(sk)->inet_num; |
@@ -435,6 +441,7 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row, | |||
435 | struct inet_bind_bucket *tb; | 441 | struct inet_bind_bucket *tb; |
436 | int ret; | 442 | int ret; |
437 | struct net *net = sock_net(sk); | 443 | struct net *net = sock_net(sk); |
444 | int twrefcnt = 1; | ||
438 | 445 | ||
439 | if (!snum) { | 446 | if (!snum) { |
440 | int i, remaining, low, high, port; | 447 | int i, remaining, low, high, port; |
@@ -493,13 +500,18 @@ ok: | |||
493 | inet_bind_hash(sk, tb, port); | 500 | inet_bind_hash(sk, tb, port); |
494 | if (sk_unhashed(sk)) { | 501 | if (sk_unhashed(sk)) { |
495 | inet_sk(sk)->inet_sport = htons(port); | 502 | inet_sk(sk)->inet_sport = htons(port); |
496 | hash(sk); | 503 | twrefcnt += hash(sk, tw); |
497 | } | 504 | } |
505 | if (tw) | ||
506 | twrefcnt += inet_twsk_bind_unhash(tw, hinfo); | ||
498 | spin_unlock(&head->lock); | 507 | spin_unlock(&head->lock); |
499 | 508 | ||
500 | if (tw) { | 509 | if (tw) { |
501 | inet_twsk_deschedule(tw, death_row); | 510 | inet_twsk_deschedule(tw, death_row); |
502 | inet_twsk_put(tw); | 511 | while (twrefcnt) { |
512 | twrefcnt--; | ||
513 | inet_twsk_put(tw); | ||
514 | } | ||
503 | } | 515 | } |
504 | 516 | ||
505 | ret = 0; | 517 | ret = 0; |
@@ -510,7 +522,7 @@ ok: | |||
510 | tb = inet_csk(sk)->icsk_bind_hash; | 522 | tb = inet_csk(sk)->icsk_bind_hash; |
511 | spin_lock_bh(&head->lock); | 523 | spin_lock_bh(&head->lock); |
512 | if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { | 524 | if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { |
513 | hash(sk); | 525 | hash(sk, NULL); |
514 | spin_unlock_bh(&head->lock); | 526 | spin_unlock_bh(&head->lock); |
515 | return 0; | 527 | return 0; |
516 | } else { | 528 | } else { |
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 0fdf45e4c90c..cc94cc2d8b2d 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
@@ -15,9 +15,13 @@ | |||
15 | #include <net/ip.h> | 15 | #include <net/ip.h> |
16 | 16 | ||
17 | 17 | ||
18 | /* | 18 | /** |
19 | * unhash a timewait socket from established hash | 19 | * inet_twsk_unhash - unhash a timewait socket from established hash |
20 | * lock must be hold by caller | 20 | * @tw: timewait socket |
21 | * | ||
22 | * unhash a timewait socket from established hash, if hashed. | ||
23 | * ehash lock must be held by caller. | ||
24 | * Returns 1 if caller should call inet_twsk_put() after lock release. | ||
21 | */ | 25 | */ |
22 | int inet_twsk_unhash(struct inet_timewait_sock *tw) | 26 | int inet_twsk_unhash(struct inet_timewait_sock *tw) |
23 | { | 27 | { |
@@ -26,6 +30,37 @@ int inet_twsk_unhash(struct inet_timewait_sock *tw) | |||
26 | 30 | ||
27 | hlist_nulls_del_rcu(&tw->tw_node); | 31 | hlist_nulls_del_rcu(&tw->tw_node); |
28 | sk_nulls_node_init(&tw->tw_node); | 32 | sk_nulls_node_init(&tw->tw_node); |
33 | /* | ||
34 | * We cannot call inet_twsk_put() ourself under lock, | ||
35 | * caller must call it for us. | ||
36 | */ | ||
37 | return 1; | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * inet_twsk_bind_unhash - unhash a timewait socket from bind hash | ||
42 | * @tw: timewait socket | ||
43 | * @hashinfo: hashinfo pointer | ||
44 | * | ||
45 | * unhash a timewait socket from bind hash, if hashed. | ||
46 | * bind hash lock must be held by caller. | ||
47 | * Returns 1 if caller should call inet_twsk_put() after lock release. | ||
48 | */ | ||
49 | int inet_twsk_bind_unhash(struct inet_timewait_sock *tw, | ||
50 | struct inet_hashinfo *hashinfo) | ||
51 | { | ||
52 | struct inet_bind_bucket *tb = tw->tw_tb; | ||
53 | |||
54 | if (!tb) | ||
55 | return 0; | ||
56 | |||
57 | __hlist_del(&tw->tw_bind_node); | ||
58 | tw->tw_tb = NULL; | ||
59 | inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb); | ||
60 | /* | ||
61 | * We cannot call inet_twsk_put() ourself under lock, | ||
62 | * caller must call it for us. | ||
63 | */ | ||
29 | return 1; | 64 | return 1; |
30 | } | 65 | } |
31 | 66 | ||
@@ -34,7 +69,6 @@ static void __inet_twsk_kill(struct inet_timewait_sock *tw, | |||
34 | struct inet_hashinfo *hashinfo) | 69 | struct inet_hashinfo *hashinfo) |
35 | { | 70 | { |
36 | struct inet_bind_hashbucket *bhead; | 71 | struct inet_bind_hashbucket *bhead; |
37 | struct inet_bind_bucket *tb; | ||
38 | int refcnt; | 72 | int refcnt; |
39 | /* Unlink from established hashes. */ | 73 | /* Unlink from established hashes. */ |
40 | spinlock_t *lock = inet_ehash_lockp(hashinfo, tw->tw_hash); | 74 | spinlock_t *lock = inet_ehash_lockp(hashinfo, tw->tw_hash); |
@@ -46,15 +80,11 @@ static void __inet_twsk_kill(struct inet_timewait_sock *tw, | |||
46 | /* Disassociate with bind bucket. */ | 80 | /* Disassociate with bind bucket. */ |
47 | bhead = &hashinfo->bhash[inet_bhashfn(twsk_net(tw), tw->tw_num, | 81 | bhead = &hashinfo->bhash[inet_bhashfn(twsk_net(tw), tw->tw_num, |
48 | hashinfo->bhash_size)]; | 82 | hashinfo->bhash_size)]; |
83 | |||
49 | spin_lock(&bhead->lock); | 84 | spin_lock(&bhead->lock); |
50 | tb = tw->tw_tb; | 85 | refcnt += inet_twsk_bind_unhash(tw, hashinfo); |
51 | if (tb) { | ||
52 | __hlist_del(&tw->tw_bind_node); | ||
53 | tw->tw_tb = NULL; | ||
54 | inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb); | ||
55 | refcnt++; | ||
56 | } | ||
57 | spin_unlock(&bhead->lock); | 86 | spin_unlock(&bhead->lock); |
87 | |||
58 | #ifdef SOCK_REFCNT_DEBUG | 88 | #ifdef SOCK_REFCNT_DEBUG |
59 | if (atomic_read(&tw->tw_refcnt) != 1) { | 89 | if (atomic_read(&tw->tw_refcnt) != 1) { |
60 | printk(KERN_DEBUG "%s timewait_sock %p refcnt=%d\n", | 90 | printk(KERN_DEBUG "%s timewait_sock %p refcnt=%d\n", |
@@ -126,7 +156,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, | |||
126 | 156 | ||
127 | /* | 157 | /* |
128 | * Notes : | 158 | * Notes : |
129 | * - We initially set tw_refcnt to 0 in inet_twsk_alloc() | 159 | * - We initially set tw_refcnt to 0 in inet_twsk_alloc() |
130 | * - We add one reference for the bhash link | 160 | * - We add one reference for the bhash link |
131 | * - We add one reference for the ehash link | 161 | * - We add one reference for the ehash link |
132 | * - We want this refcnt update done before allowing other | 162 | * - We want this refcnt update done before allowing other |
@@ -136,7 +166,6 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, | |||
136 | 166 | ||
137 | spin_unlock(lock); | 167 | spin_unlock(lock); |
138 | } | 168 | } |
139 | |||
140 | EXPORT_SYMBOL_GPL(__inet_twsk_hashdance); | 169 | EXPORT_SYMBOL_GPL(__inet_twsk_hashdance); |
141 | 170 | ||
142 | struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int state) | 171 | struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int state) |
@@ -177,7 +206,6 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat | |||
177 | 206 | ||
178 | return tw; | 207 | return tw; |
179 | } | 208 | } |
180 | |||
181 | EXPORT_SYMBOL_GPL(inet_twsk_alloc); | 209 | EXPORT_SYMBOL_GPL(inet_twsk_alloc); |
182 | 210 | ||
183 | /* Returns non-zero if quota exceeded. */ | 211 | /* Returns non-zero if quota exceeded. */ |
@@ -256,7 +284,6 @@ void inet_twdr_hangman(unsigned long data) | |||
256 | out: | 284 | out: |
257 | spin_unlock(&twdr->death_lock); | 285 | spin_unlock(&twdr->death_lock); |
258 | } | 286 | } |
259 | |||
260 | EXPORT_SYMBOL_GPL(inet_twdr_hangman); | 287 | EXPORT_SYMBOL_GPL(inet_twdr_hangman); |
261 | 288 | ||
262 | void inet_twdr_twkill_work(struct work_struct *work) | 289 | void inet_twdr_twkill_work(struct work_struct *work) |
@@ -287,7 +314,6 @@ void inet_twdr_twkill_work(struct work_struct *work) | |||
287 | spin_unlock_bh(&twdr->death_lock); | 314 | spin_unlock_bh(&twdr->death_lock); |
288 | } | 315 | } |
289 | } | 316 | } |
290 | |||
291 | EXPORT_SYMBOL_GPL(inet_twdr_twkill_work); | 317 | EXPORT_SYMBOL_GPL(inet_twdr_twkill_work); |
292 | 318 | ||
293 | /* These are always called from BH context. See callers in | 319 | /* These are always called from BH context. See callers in |
@@ -307,7 +333,6 @@ void inet_twsk_deschedule(struct inet_timewait_sock *tw, | |||
307 | spin_unlock(&twdr->death_lock); | 333 | spin_unlock(&twdr->death_lock); |
308 | __inet_twsk_kill(tw, twdr->hashinfo); | 334 | __inet_twsk_kill(tw, twdr->hashinfo); |
309 | } | 335 | } |
310 | |||
311 | EXPORT_SYMBOL(inet_twsk_deschedule); | 336 | EXPORT_SYMBOL(inet_twsk_deschedule); |
312 | 337 | ||
313 | void inet_twsk_schedule(struct inet_timewait_sock *tw, | 338 | void inet_twsk_schedule(struct inet_timewait_sock *tw, |
@@ -388,7 +413,6 @@ void inet_twsk_schedule(struct inet_timewait_sock *tw, | |||
388 | mod_timer(&twdr->tw_timer, jiffies + twdr->period); | 413 | mod_timer(&twdr->tw_timer, jiffies + twdr->period); |
389 | spin_unlock(&twdr->death_lock); | 414 | spin_unlock(&twdr->death_lock); |
390 | } | 415 | } |
391 | |||
392 | EXPORT_SYMBOL_GPL(inet_twsk_schedule); | 416 | EXPORT_SYMBOL_GPL(inet_twsk_schedule); |
393 | 417 | ||
394 | void inet_twdr_twcal_tick(unsigned long data) | 418 | void inet_twdr_twcal_tick(unsigned long data) |
@@ -449,7 +473,6 @@ out: | |||
449 | #endif | 473 | #endif |
450 | spin_unlock(&twdr->death_lock); | 474 | spin_unlock(&twdr->death_lock); |
451 | } | 475 | } |
452 | |||
453 | EXPORT_SYMBOL_GPL(inet_twdr_twcal_tick); | 476 | EXPORT_SYMBOL_GPL(inet_twdr_twcal_tick); |
454 | 477 | ||
455 | void inet_twsk_purge(struct inet_hashinfo *hashinfo, | 478 | void inet_twsk_purge(struct inet_hashinfo *hashinfo, |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index c8666b70cde0..b0a26bb25e2e 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2540,11 +2540,6 @@ static int do_tcp_getsockopt(struct sock *sk, int level, | |||
2540 | ctd.tcpct_cookie_desired = cvp->cookie_desired; | 2540 | ctd.tcpct_cookie_desired = cvp->cookie_desired; |
2541 | ctd.tcpct_s_data_desired = cvp->s_data_desired; | 2541 | ctd.tcpct_s_data_desired = cvp->s_data_desired; |
2542 | 2542 | ||
2543 | /* Cookie(s) saved, return as nonce */ | ||
2544 | if (sizeof(ctd.tcpct_value) < cvp->cookie_pair_size) { | ||
2545 | /* impossible? */ | ||
2546 | return -EINVAL; | ||
2547 | } | ||
2548 | memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0], | 2543 | memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0], |
2549 | cvp->cookie_pair_size); | 2544 | cvp->cookie_pair_size); |
2550 | ctd.tcpct_used = cvp->cookie_pair_size; | 2545 | ctd.tcpct_used = cvp->cookie_pair_size; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 57ae96a04220..12cab7d74dba 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2717,6 +2717,35 @@ static void tcp_try_undo_dsack(struct sock *sk) | |||
2717 | } | 2717 | } |
2718 | } | 2718 | } |
2719 | 2719 | ||
2720 | /* We can clear retrans_stamp when there are no retransmissions in the | ||
2721 | * window. It would seem that it is trivially available for us in | ||
2722 | * tp->retrans_out, however, that kind of assumptions doesn't consider | ||
2723 | * what will happen if errors occur when sending retransmission for the | ||
2724 | * second time. ...It could the that such segment has only | ||
2725 | * TCPCB_EVER_RETRANS set at the present time. It seems that checking | ||
2726 | * the head skb is enough except for some reneging corner cases that | ||
2727 | * are not worth the effort. | ||
2728 | * | ||
2729 | * Main reason for all this complexity is the fact that connection dying | ||
2730 | * time now depends on the validity of the retrans_stamp, in particular, | ||
2731 | * that successive retransmissions of a segment must not advance | ||
2732 | * retrans_stamp under any conditions. | ||
2733 | */ | ||
2734 | static int tcp_any_retrans_done(struct sock *sk) | ||
2735 | { | ||
2736 | struct tcp_sock *tp = tcp_sk(sk); | ||
2737 | struct sk_buff *skb; | ||
2738 | |||
2739 | if (tp->retrans_out) | ||
2740 | return 1; | ||
2741 | |||
2742 | skb = tcp_write_queue_head(sk); | ||
2743 | if (unlikely(skb && TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS)) | ||
2744 | return 1; | ||
2745 | |||
2746 | return 0; | ||
2747 | } | ||
2748 | |||
2720 | /* Undo during fast recovery after partial ACK. */ | 2749 | /* Undo during fast recovery after partial ACK. */ |
2721 | 2750 | ||
2722 | static int tcp_try_undo_partial(struct sock *sk, int acked) | 2751 | static int tcp_try_undo_partial(struct sock *sk, int acked) |
@@ -2729,7 +2758,7 @@ static int tcp_try_undo_partial(struct sock *sk, int acked) | |||
2729 | /* Plain luck! Hole if filled with delayed | 2758 | /* Plain luck! Hole if filled with delayed |
2730 | * packet, rather than with a retransmit. | 2759 | * packet, rather than with a retransmit. |
2731 | */ | 2760 | */ |
2732 | if (tp->retrans_out == 0) | 2761 | if (!tcp_any_retrans_done(sk)) |
2733 | tp->retrans_stamp = 0; | 2762 | tp->retrans_stamp = 0; |
2734 | 2763 | ||
2735 | tcp_update_reordering(sk, tcp_fackets_out(tp) + acked, 1); | 2764 | tcp_update_reordering(sk, tcp_fackets_out(tp) + acked, 1); |
@@ -2788,7 +2817,7 @@ static void tcp_try_keep_open(struct sock *sk) | |||
2788 | struct tcp_sock *tp = tcp_sk(sk); | 2817 | struct tcp_sock *tp = tcp_sk(sk); |
2789 | int state = TCP_CA_Open; | 2818 | int state = TCP_CA_Open; |
2790 | 2819 | ||
2791 | if (tcp_left_out(tp) || tp->retrans_out || tp->undo_marker) | 2820 | if (tcp_left_out(tp) || tcp_any_retrans_done(sk) || tp->undo_marker) |
2792 | state = TCP_CA_Disorder; | 2821 | state = TCP_CA_Disorder; |
2793 | 2822 | ||
2794 | if (inet_csk(sk)->icsk_ca_state != state) { | 2823 | if (inet_csk(sk)->icsk_ca_state != state) { |
@@ -2803,7 +2832,7 @@ static void tcp_try_to_open(struct sock *sk, int flag) | |||
2803 | 2832 | ||
2804 | tcp_verify_left_out(tp); | 2833 | tcp_verify_left_out(tp); |
2805 | 2834 | ||
2806 | if (!tp->frto_counter && tp->retrans_out == 0) | 2835 | if (!tp->frto_counter && !tcp_any_retrans_done(sk)) |
2807 | tp->retrans_stamp = 0; | 2836 | tp->retrans_stamp = 0; |
2808 | 2837 | ||
2809 | if (flag & FLAG_ECE) | 2838 | if (flag & FLAG_ECE) |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 29002ab26e0d..15e96030ce47 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1464,7 +1464,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1464 | } | 1464 | } |
1465 | #endif | 1465 | #endif |
1466 | 1466 | ||
1467 | __inet_hash_nolisten(newsk); | 1467 | __inet_hash_nolisten(newsk, NULL); |
1468 | __inet_inherit_port(sk, newsk); | 1468 | __inet_inherit_port(sk, newsk); |
1469 | 1469 | ||
1470 | return newsk; | 1470 | return newsk; |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 8353a538cd4c..8816a20c2597 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -132,6 +132,35 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) | |||
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | /* This function calculates a "timeout" which is equivalent to the timeout of a | ||
136 | * TCP connection after "boundary" unsucessful, exponentially backed-off | ||
137 | * retransmissions with an initial RTO of TCP_RTO_MIN. | ||
138 | */ | ||
139 | static bool retransmits_timed_out(struct sock *sk, | ||
140 | unsigned int boundary) | ||
141 | { | ||
142 | unsigned int timeout, linear_backoff_thresh; | ||
143 | unsigned int start_ts; | ||
144 | |||
145 | if (!inet_csk(sk)->icsk_retransmits) | ||
146 | return false; | ||
147 | |||
148 | if (unlikely(!tcp_sk(sk)->retrans_stamp)) | ||
149 | start_ts = TCP_SKB_CB(tcp_write_queue_head(sk))->when; | ||
150 | else | ||
151 | start_ts = tcp_sk(sk)->retrans_stamp; | ||
152 | |||
153 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); | ||
154 | |||
155 | if (boundary <= linear_backoff_thresh) | ||
156 | timeout = ((2 << boundary) - 1) * TCP_RTO_MIN; | ||
157 | else | ||
158 | timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN + | ||
159 | (boundary - linear_backoff_thresh) * TCP_RTO_MAX; | ||
160 | |||
161 | return (tcp_time_stamp - start_ts) >= timeout; | ||
162 | } | ||
163 | |||
135 | /* A write timeout has occurred. Process the after effects. */ | 164 | /* A write timeout has occurred. Process the after effects. */ |
136 | static int tcp_write_timeout(struct sock *sk) | 165 | static int tcp_write_timeout(struct sock *sk) |
137 | { | 166 | { |
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index c813e294ec0c..633a6c266136 100644 --- a/net/ipv6/inet6_hashtables.c +++ b/net/ipv6/inet6_hashtables.c | |||
@@ -22,9 +22,10 @@ | |||
22 | #include <net/inet6_hashtables.h> | 22 | #include <net/inet6_hashtables.h> |
23 | #include <net/ip.h> | 23 | #include <net/ip.h> |
24 | 24 | ||
25 | void __inet6_hash(struct sock *sk) | 25 | int __inet6_hash(struct sock *sk, struct inet_timewait_sock *tw) |
26 | { | 26 | { |
27 | struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo; | 27 | struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo; |
28 | int twrefcnt = 0; | ||
28 | 29 | ||
29 | WARN_ON(!sk_unhashed(sk)); | 30 | WARN_ON(!sk_unhashed(sk)); |
30 | 31 | ||
@@ -45,10 +46,15 @@ void __inet6_hash(struct sock *sk) | |||
45 | lock = inet_ehash_lockp(hashinfo, hash); | 46 | lock = inet_ehash_lockp(hashinfo, hash); |
46 | spin_lock(lock); | 47 | spin_lock(lock); |
47 | __sk_nulls_add_node_rcu(sk, list); | 48 | __sk_nulls_add_node_rcu(sk, list); |
49 | if (tw) { | ||
50 | WARN_ON(sk->sk_hash != tw->tw_hash); | ||
51 | twrefcnt = inet_twsk_unhash(tw); | ||
52 | } | ||
48 | spin_unlock(lock); | 53 | spin_unlock(lock); |
49 | } | 54 | } |
50 | 55 | ||
51 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); | 56 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); |
57 | return twrefcnt; | ||
52 | } | 58 | } |
53 | EXPORT_SYMBOL(__inet6_hash); | 59 | EXPORT_SYMBOL(__inet6_hash); |
54 | 60 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index aadd7cef73b3..ee9cf62458d4 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -96,7 +96,7 @@ static void tcp_v6_hash(struct sock *sk) | |||
96 | return; | 96 | return; |
97 | } | 97 | } |
98 | local_bh_disable(); | 98 | local_bh_disable(); |
99 | __inet6_hash(sk); | 99 | __inet6_hash(sk, NULL); |
100 | local_bh_enable(); | 100 | local_bh_enable(); |
101 | } | 101 | } |
102 | } | 102 | } |
@@ -1496,7 +1496,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1496 | } | 1496 | } |
1497 | #endif | 1497 | #endif |
1498 | 1498 | ||
1499 | __inet6_hash(newsk); | 1499 | __inet6_hash(newsk, NULL); |
1500 | __inet_inherit_port(sk, newsk); | 1500 | __inet_inherit_port(sk, newsk); |
1501 | 1501 | ||
1502 | return newsk; | 1502 | return newsk; |
diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h index b001c361ad30..4300df35d37d 100644 --- a/net/irda/irnet/irnet.h +++ b/net/irda/irnet/irnet.h | |||
@@ -249,6 +249,7 @@ | |||
249 | #include <linux/poll.h> | 249 | #include <linux/poll.h> |
250 | #include <linux/capability.h> | 250 | #include <linux/capability.h> |
251 | #include <linux/ctype.h> /* isspace() */ | 251 | #include <linux/ctype.h> /* isspace() */ |
252 | #include <linux/string.h> /* skip_spaces() */ | ||
252 | #include <asm/uaccess.h> | 253 | #include <asm/uaccess.h> |
253 | #include <linux/init.h> | 254 | #include <linux/init.h> |
254 | 255 | ||
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 7dea882dbb75..156020d138b5 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
@@ -76,9 +76,8 @@ irnet_ctrl_write(irnet_socket * ap, | |||
76 | /* Look at the next command */ | 76 | /* Look at the next command */ |
77 | start = next; | 77 | start = next; |
78 | 78 | ||
79 | /* Scrap whitespaces before the command */ | 79 | /* Scrap whitespaces before the command */ |
80 | while(isspace(*start)) | 80 | start = skip_spaces(start); |
81 | start++; | ||
82 | 81 | ||
83 | /* ',' is our command separator */ | 82 | /* ',' is our command separator */ |
84 | next = strchr(start, ','); | 83 | next = strchr(start, ','); |
@@ -133,8 +132,7 @@ irnet_ctrl_write(irnet_socket * ap, | |||
133 | char * endp; | 132 | char * endp; |
134 | 133 | ||
135 | /* Scrap whitespaces before the command */ | 134 | /* Scrap whitespaces before the command */ |
136 | while(isspace(*begp)) | 135 | begp = skip_spaces(begp); |
137 | begp++; | ||
138 | 136 | ||
139 | /* Convert argument to a number (last arg is the base) */ | 137 | /* Convert argument to a number (last arg is the base) */ |
140 | addr = simple_strtoul(begp, &endp, 16); | 138 | addr = simple_strtoul(begp, &endp, 16); |
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 1e428863574f..c18286a2167b 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
@@ -221,7 +221,7 @@ static int afiucv_pm_restore_thaw(struct device *dev) | |||
221 | return 0; | 221 | return 0; |
222 | } | 222 | } |
223 | 223 | ||
224 | static struct dev_pm_ops afiucv_pm_ops = { | 224 | static const struct dev_pm_ops afiucv_pm_ops = { |
225 | .prepare = afiucv_pm_prepare, | 225 | .prepare = afiucv_pm_prepare, |
226 | .complete = afiucv_pm_complete, | 226 | .complete = afiucv_pm_complete, |
227 | .freeze = afiucv_pm_freeze, | 227 | .freeze = afiucv_pm_freeze, |
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 3b1f5f5f8de7..fd8b28361a64 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c | |||
@@ -93,7 +93,7 @@ static int iucv_pm_freeze(struct device *); | |||
93 | static int iucv_pm_thaw(struct device *); | 93 | static int iucv_pm_thaw(struct device *); |
94 | static int iucv_pm_restore(struct device *); | 94 | static int iucv_pm_restore(struct device *); |
95 | 95 | ||
96 | static struct dev_pm_ops iucv_pm_ops = { | 96 | static const struct dev_pm_ops iucv_pm_ops = { |
97 | .prepare = iucv_pm_prepare, | 97 | .prepare = iucv_pm_prepare, |
98 | .complete = iucv_pm_complete, | 98 | .complete = iucv_pm_complete, |
99 | .freeze = iucv_pm_freeze, | 99 | .freeze = iucv_pm_freeze, |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 84209fbbeb17..76fa6fef6473 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1193,6 +1193,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1193 | x->aalg->alg_key_len = key->sadb_key_bits; | 1193 | x->aalg->alg_key_len = key->sadb_key_bits; |
1194 | memcpy(x->aalg->alg_key, key+1, keysize); | 1194 | memcpy(x->aalg->alg_key, key+1, keysize); |
1195 | } | 1195 | } |
1196 | x->aalg->alg_trunc_len = a->uinfo.auth.icv_truncbits; | ||
1196 | x->props.aalgo = sa->sadb_sa_auth; | 1197 | x->props.aalgo = sa->sadb_sa_auth; |
1197 | /* x->algo.flags = sa->sadb_sa_flags; */ | 1198 | /* x->algo.flags = sa->sadb_sa_flags; */ |
1198 | } | 1199 | } |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 93ee1fd5c08d..6dc3579c0ac5 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -354,7 +354,8 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
354 | sinfo->rx_packets = sta->rx_packets; | 354 | sinfo->rx_packets = sta->rx_packets; |
355 | sinfo->tx_packets = sta->tx_packets; | 355 | sinfo->tx_packets = sta->tx_packets; |
356 | 356 | ||
357 | if (sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) { | 357 | if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || |
358 | (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { | ||
358 | sinfo->filled |= STATION_INFO_SIGNAL; | 359 | sinfo->filled |= STATION_INFO_SIGNAL; |
359 | sinfo->signal = (s8)sta->last_signal; | 360 | sinfo->signal = (s8)sta->last_signal; |
360 | } | 361 | } |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 419f186cfcf0..91dc8636d644 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -746,6 +746,7 @@ struct ieee80211_local { | |||
746 | unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ | 746 | unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ |
747 | 747 | ||
748 | bool pspolling; | 748 | bool pspolling; |
749 | bool scan_ps_enabled; | ||
749 | /* | 750 | /* |
750 | * PS can only be enabled when we have exactly one managed | 751 | * PS can only be enabled when we have exactly one managed |
751 | * interface (and monitors) in PS, this then points there. | 752 | * interface (and monitors) in PS, this then points there. |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index c0fe46493f71..6a4331429598 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -427,7 +427,7 @@ int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr, | |||
427 | char *addr5, char *addr6) | 427 | char *addr5, char *addr6) |
428 | { | 428 | { |
429 | int aelen = 0; | 429 | int aelen = 0; |
430 | memset(meshhdr, 0, sizeof(meshhdr)); | 430 | memset(meshhdr, 0, sizeof(*meshhdr)); |
431 | meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; | 431 | meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; |
432 | put_unaligned(cpu_to_le32(sdata->u.mesh.mesh_seqnum), &meshhdr->seqnum); | 432 | put_unaligned(cpu_to_le32(sdata->u.mesh.mesh_seqnum), &meshhdr->seqnum); |
433 | sdata->u.mesh.mesh_seqnum++; | 433 | sdata->u.mesh.mesh_seqnum++; |
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 31e102541869..85562c59d7d6 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
@@ -188,8 +188,9 @@ struct mesh_rmc { | |||
188 | */ | 188 | */ |
189 | #define MESH_PREQ_MIN_INT 10 | 189 | #define MESH_PREQ_MIN_INT 10 |
190 | #define MESH_DIAM_TRAVERSAL_TIME 50 | 190 | #define MESH_DIAM_TRAVERSAL_TIME 50 |
191 | /* Paths will be refreshed if they are closer than PATH_REFRESH_TIME to their | 191 | /* A path will be refreshed if it is used PATH_REFRESH_TIME milliseconds before |
192 | * expiration | 192 | * timing out. This way it will remain ACTIVE and no data frames will be |
193 | * unnecesarily held in the pending queue. | ||
193 | */ | 194 | */ |
194 | #define MESH_PATH_REFRESH_TIME 1000 | 195 | #define MESH_PATH_REFRESH_TIME 1000 |
195 | #define MESH_MIN_DISCOVERY_TIMEOUT (2 * MESH_DIAM_TRAVERSAL_TIME) | 196 | #define MESH_MIN_DISCOVERY_TIMEOUT (2 * MESH_DIAM_TRAVERSAL_TIME) |
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 833b2f3670c5..d28acb6b1f81 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -937,7 +937,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, | |||
937 | 937 | ||
938 | if (mpath->flags & MESH_PATH_ACTIVE) { | 938 | if (mpath->flags & MESH_PATH_ACTIVE) { |
939 | if (time_after(jiffies, | 939 | if (time_after(jiffies, |
940 | mpath->exp_time + | 940 | mpath->exp_time - |
941 | msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && | 941 | msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && |
942 | !memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) && | 942 | !memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) && |
943 | !(mpath->flags & MESH_PATH_RESOLVING) && | 943 | !(mpath->flags & MESH_PATH_RESOLVING) && |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6dc7b5ad9a41..d8d50fb5e823 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1083,8 +1083,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1083 | 1083 | ||
1084 | ieee80211_set_wmm_default(sdata); | 1084 | ieee80211_set_wmm_default(sdata); |
1085 | 1085 | ||
1086 | ieee80211_recalc_idle(local); | ||
1087 | |||
1088 | /* channel(_type) changes are handled by ieee80211_hw_config */ | 1086 | /* channel(_type) changes are handled by ieee80211_hw_config */ |
1089 | local->oper_channel_type = NL80211_CHAN_NO_HT; | 1087 | local->oper_channel_type = NL80211_CHAN_NO_HT; |
1090 | 1088 | ||
@@ -1370,6 +1368,7 @@ ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, | |||
1370 | 1368 | ||
1371 | if (!wk) { | 1369 | if (!wk) { |
1372 | ieee80211_set_disassoc(sdata, true); | 1370 | ieee80211_set_disassoc(sdata, true); |
1371 | ieee80211_recalc_idle(sdata->local); | ||
1373 | } else { | 1372 | } else { |
1374 | list_del(&wk->list); | 1373 | list_del(&wk->list); |
1375 | kfree(wk); | 1374 | kfree(wk); |
@@ -1403,6 +1402,7 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1403 | sdata->dev->name, mgmt->sa, reason_code); | 1402 | sdata->dev->name, mgmt->sa, reason_code); |
1404 | 1403 | ||
1405 | ieee80211_set_disassoc(sdata, false); | 1404 | ieee80211_set_disassoc(sdata, false); |
1405 | ieee80211_recalc_idle(sdata->local); | ||
1406 | return RX_MGMT_CFG80211_DISASSOC; | 1406 | return RX_MGMT_CFG80211_DISASSOC; |
1407 | } | 1407 | } |
1408 | 1408 | ||
@@ -2117,6 +2117,7 @@ static void ieee80211_sta_work(struct work_struct *work) | |||
2117 | " after %dms, disconnecting.\n", | 2117 | " after %dms, disconnecting.\n", |
2118 | bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ); | 2118 | bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ); |
2119 | ieee80211_set_disassoc(sdata, true); | 2119 | ieee80211_set_disassoc(sdata, true); |
2120 | ieee80211_recalc_idle(local); | ||
2120 | mutex_unlock(&ifmgd->mtx); | 2121 | mutex_unlock(&ifmgd->mtx); |
2121 | /* | 2122 | /* |
2122 | * must be outside lock due to cfg80211, | 2123 | * must be outside lock due to cfg80211, |
@@ -2560,6 +2561,8 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
2560 | IEEE80211_STYPE_DEAUTH, req->reason_code, | 2561 | IEEE80211_STYPE_DEAUTH, req->reason_code, |
2561 | cookie); | 2562 | cookie); |
2562 | 2563 | ||
2564 | ieee80211_recalc_idle(sdata->local); | ||
2565 | |||
2563 | return 0; | 2566 | return 0; |
2564 | } | 2567 | } |
2565 | 2568 | ||
@@ -2592,5 +2595,8 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, | |||
2592 | ieee80211_send_deauth_disassoc(sdata, req->bss->bssid, | 2595 | ieee80211_send_deauth_disassoc(sdata, req->bss->bssid, |
2593 | IEEE80211_STYPE_DISASSOC, req->reason_code, | 2596 | IEEE80211_STYPE_DISASSOC, req->reason_code, |
2594 | cookie); | 2597 | cookie); |
2598 | |||
2599 | ieee80211_recalc_idle(sdata->local); | ||
2600 | |||
2595 | return 0; | 2601 | return 0; |
2596 | } | 2602 | } |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index f237df408378..9f2807aeaf52 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1712,7 +1712,6 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1712 | mpp_path_add(proxied_addr, mpp_addr, sdata); | 1712 | mpp_path_add(proxied_addr, mpp_addr, sdata); |
1713 | } else { | 1713 | } else { |
1714 | spin_lock_bh(&mppath->state_lock); | 1714 | spin_lock_bh(&mppath->state_lock); |
1715 | mppath->exp_time = jiffies; | ||
1716 | if (compare_ether_addr(mppath->mpp, mpp_addr) != 0) | 1715 | if (compare_ether_addr(mppath->mpp, mpp_addr) != 0) |
1717 | memcpy(mppath->mpp, mpp_addr, ETH_ALEN); | 1716 | memcpy(mppath->mpp, mpp_addr, ETH_ALEN); |
1718 | spin_unlock_bh(&mppath->state_lock); | 1717 | spin_unlock_bh(&mppath->state_lock); |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 4cf387c944bf..f1a4c7160300 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -227,7 +227,8 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) | |||
227 | static void ieee80211_scan_ps_enable(struct ieee80211_sub_if_data *sdata) | 227 | static void ieee80211_scan_ps_enable(struct ieee80211_sub_if_data *sdata) |
228 | { | 228 | { |
229 | struct ieee80211_local *local = sdata->local; | 229 | struct ieee80211_local *local = sdata->local; |
230 | bool ps = false; | 230 | |
231 | local->scan_ps_enabled = false; | ||
231 | 232 | ||
232 | /* FIXME: what to do when local->pspolling is true? */ | 233 | /* FIXME: what to do when local->pspolling is true? */ |
233 | 234 | ||
@@ -235,12 +236,13 @@ static void ieee80211_scan_ps_enable(struct ieee80211_sub_if_data *sdata) | |||
235 | cancel_work_sync(&local->dynamic_ps_enable_work); | 236 | cancel_work_sync(&local->dynamic_ps_enable_work); |
236 | 237 | ||
237 | if (local->hw.conf.flags & IEEE80211_CONF_PS) { | 238 | if (local->hw.conf.flags & IEEE80211_CONF_PS) { |
238 | ps = true; | 239 | local->scan_ps_enabled = true; |
239 | local->hw.conf.flags &= ~IEEE80211_CONF_PS; | 240 | local->hw.conf.flags &= ~IEEE80211_CONF_PS; |
240 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | 241 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); |
241 | } | 242 | } |
242 | 243 | ||
243 | if (!ps || !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) | 244 | if (!(local->scan_ps_enabled) || |
245 | !(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) | ||
244 | /* | 246 | /* |
245 | * If power save was enabled, no need to send a nullfunc | 247 | * If power save was enabled, no need to send a nullfunc |
246 | * frame because AP knows that we are sleeping. But if the | 248 | * frame because AP knows that we are sleeping. But if the |
@@ -261,7 +263,7 @@ static void ieee80211_scan_ps_disable(struct ieee80211_sub_if_data *sdata) | |||
261 | 263 | ||
262 | if (!local->ps_sdata) | 264 | if (!local->ps_sdata) |
263 | ieee80211_send_nullfunc(local, sdata, 0); | 265 | ieee80211_send_nullfunc(local, sdata, 0); |
264 | else { | 266 | else if (local->scan_ps_enabled) { |
265 | /* | 267 | /* |
266 | * In !IEEE80211_HW_PS_NULLFUNC_STACK case the hardware | 268 | * In !IEEE80211_HW_PS_NULLFUNC_STACK case the hardware |
267 | * will send a nullfunc frame with the powersave bit set | 269 | * will send a nullfunc frame with the powersave bit set |
@@ -277,6 +279,16 @@ static void ieee80211_scan_ps_disable(struct ieee80211_sub_if_data *sdata) | |||
277 | */ | 279 | */ |
278 | local->hw.conf.flags |= IEEE80211_CONF_PS; | 280 | local->hw.conf.flags |= IEEE80211_CONF_PS; |
279 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | 281 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); |
282 | } else if (local->hw.conf.dynamic_ps_timeout > 0) { | ||
283 | /* | ||
284 | * If IEEE80211_CONF_PS was not set and the dynamic_ps_timer | ||
285 | * had been running before leaving the operating channel, | ||
286 | * restart the timer now and send a nullfunc frame to inform | ||
287 | * the AP that we are awake. | ||
288 | */ | ||
289 | ieee80211_send_nullfunc(local, sdata, 0); | ||
290 | mod_timer(&local->dynamic_ps_timer, jiffies + | ||
291 | msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout)); | ||
280 | } | 292 | } |
281 | } | 293 | } |
282 | 294 | ||
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index d09f78bb2442..78a6e924c7e1 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -579,7 +579,7 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, | |||
579 | if (elen > left) | 579 | if (elen > left) |
580 | break; | 580 | break; |
581 | 581 | ||
582 | if (calc_crc && id < 64 && (filter & BIT(id))) | 582 | if (calc_crc && id < 64 && (filter & (1ULL << id))) |
583 | crc = crc32_be(crc, pos - 2, elen + 2); | 583 | crc = crc32_be(crc, pos - 2, elen + 2); |
584 | 584 | ||
585 | switch (id) { | 585 | switch (id) { |
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index eb0ceb846527..fc70a49c0afd 100644 --- a/net/netfilter/xt_recent.c +++ b/net/netfilter/xt_recent.c | |||
@@ -482,8 +482,7 @@ static ssize_t recent_old_proc_write(struct file *file, | |||
482 | if (copy_from_user(buf, input, size)) | 482 | if (copy_from_user(buf, input, size)) |
483 | return -EFAULT; | 483 | return -EFAULT; |
484 | 484 | ||
485 | while (isspace(*c)) | 485 | c = skip_spaces(c); |
486 | c++; | ||
487 | 486 | ||
488 | if (size - (c - buf) < 5) | 487 | if (size - (c - buf) < 5) |
489 | return c - buf; | 488 | return c - buf; |
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 448e5a0fcc2e..c218e07e5caf 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
@@ -579,6 +579,8 @@ static ssize_t rfkill_name_show(struct device *dev, | |||
579 | 579 | ||
580 | static const char *rfkill_get_type_str(enum rfkill_type type) | 580 | static const char *rfkill_get_type_str(enum rfkill_type type) |
581 | { | 581 | { |
582 | BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_FM + 1); | ||
583 | |||
582 | switch (type) { | 584 | switch (type) { |
583 | case RFKILL_TYPE_WLAN: | 585 | case RFKILL_TYPE_WLAN: |
584 | return "wlan"; | 586 | return "wlan"; |
@@ -597,8 +599,6 @@ static const char *rfkill_get_type_str(enum rfkill_type type) | |||
597 | default: | 599 | default: |
598 | BUG(); | 600 | BUG(); |
599 | } | 601 | } |
600 | |||
601 | BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_FM + 1); | ||
602 | } | 602 | } |
603 | 603 | ||
604 | static ssize_t rfkill_type_show(struct device *dev, | 604 | static ssize_t rfkill_type_show(struct device *dev, |
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index c7450c8f0a7c..6dcdd2517819 100644 --- a/net/sunrpc/addr.c +++ b/net/sunrpc/addr.c | |||
@@ -55,16 +55,8 @@ static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, | |||
55 | 55 | ||
56 | /* | 56 | /* |
57 | * RFC 4291, Section 2.2.1 | 57 | * RFC 4291, Section 2.2.1 |
58 | * | ||
59 | * To keep the result as short as possible, especially | ||
60 | * since we don't shorthand, we don't want leading zeros | ||
61 | * in each halfword, so avoid %pI6. | ||
62 | */ | 58 | */ |
63 | return snprintf(buf, buflen, "%x:%x:%x:%x:%x:%x:%x:%x", | 59 | return snprintf(buf, buflen, "%pI6c", addr); |
64 | ntohs(addr->s6_addr16[0]), ntohs(addr->s6_addr16[1]), | ||
65 | ntohs(addr->s6_addr16[2]), ntohs(addr->s6_addr16[3]), | ||
66 | ntohs(addr->s6_addr16[4]), ntohs(addr->s6_addr16[5]), | ||
67 | ntohs(addr->s6_addr16[6]), ntohs(addr->s6_addr16[7])); | ||
68 | } | 60 | } |
69 | 61 | ||
70 | static size_t rpc_ntop6(const struct sockaddr *sap, | 62 | static size_t rpc_ntop6(const struct sockaddr *sap, |
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 7535a7bed2fa..f394fc190a49 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -123,16 +123,19 @@ rpcauth_unhash_cred_locked(struct rpc_cred *cred) | |||
123 | clear_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags); | 123 | clear_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags); |
124 | } | 124 | } |
125 | 125 | ||
126 | static void | 126 | static int |
127 | rpcauth_unhash_cred(struct rpc_cred *cred) | 127 | rpcauth_unhash_cred(struct rpc_cred *cred) |
128 | { | 128 | { |
129 | spinlock_t *cache_lock; | 129 | spinlock_t *cache_lock; |
130 | int ret; | ||
130 | 131 | ||
131 | cache_lock = &cred->cr_auth->au_credcache->lock; | 132 | cache_lock = &cred->cr_auth->au_credcache->lock; |
132 | spin_lock(cache_lock); | 133 | spin_lock(cache_lock); |
133 | if (atomic_read(&cred->cr_count) == 0) | 134 | ret = atomic_read(&cred->cr_count) == 0; |
135 | if (ret) | ||
134 | rpcauth_unhash_cred_locked(cred); | 136 | rpcauth_unhash_cred_locked(cred); |
135 | spin_unlock(cache_lock); | 137 | spin_unlock(cache_lock); |
138 | return ret; | ||
136 | } | 139 | } |
137 | 140 | ||
138 | /* | 141 | /* |
@@ -446,31 +449,35 @@ void | |||
446 | put_rpccred(struct rpc_cred *cred) | 449 | put_rpccred(struct rpc_cred *cred) |
447 | { | 450 | { |
448 | /* Fast path for unhashed credentials */ | 451 | /* Fast path for unhashed credentials */ |
449 | if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) | 452 | if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) == 0) { |
450 | goto need_lock; | 453 | if (atomic_dec_and_test(&cred->cr_count)) |
451 | 454 | cred->cr_ops->crdestroy(cred); | |
452 | if (!atomic_dec_and_test(&cred->cr_count)) | ||
453 | return; | 455 | return; |
454 | goto out_destroy; | 456 | } |
455 | need_lock: | 457 | |
456 | if (!atomic_dec_and_lock(&cred->cr_count, &rpc_credcache_lock)) | 458 | if (!atomic_dec_and_lock(&cred->cr_count, &rpc_credcache_lock)) |
457 | return; | 459 | return; |
458 | if (!list_empty(&cred->cr_lru)) { | 460 | if (!list_empty(&cred->cr_lru)) { |
459 | number_cred_unused--; | 461 | number_cred_unused--; |
460 | list_del_init(&cred->cr_lru); | 462 | list_del_init(&cred->cr_lru); |
461 | } | 463 | } |
462 | if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) == 0) | ||
463 | rpcauth_unhash_cred(cred); | ||
464 | if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) { | 464 | if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) { |
465 | cred->cr_expire = jiffies; | 465 | if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0) { |
466 | list_add_tail(&cred->cr_lru, &cred_unused); | 466 | cred->cr_expire = jiffies; |
467 | number_cred_unused++; | 467 | list_add_tail(&cred->cr_lru, &cred_unused); |
468 | spin_unlock(&rpc_credcache_lock); | 468 | number_cred_unused++; |
469 | return; | 469 | goto out_nodestroy; |
470 | } | ||
471 | if (!rpcauth_unhash_cred(cred)) { | ||
472 | /* We were hashed and someone looked us up... */ | ||
473 | goto out_nodestroy; | ||
474 | } | ||
470 | } | 475 | } |
471 | spin_unlock(&rpc_credcache_lock); | 476 | spin_unlock(&rpc_credcache_lock); |
472 | out_destroy: | ||
473 | cred->cr_ops->crdestroy(cred); | 477 | cred->cr_ops->crdestroy(cred); |
478 | return; | ||
479 | out_nodestroy: | ||
480 | spin_unlock(&rpc_credcache_lock); | ||
474 | } | 481 | } |
475 | EXPORT_SYMBOL_GPL(put_rpccred); | 482 | EXPORT_SYMBOL_GPL(put_rpccred); |
476 | 483 | ||
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index fc6a43ccd950..3c3c50f38a1c 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -304,7 +304,7 @@ __gss_find_upcall(struct rpc_inode *rpci, uid_t uid) | |||
304 | * to that upcall instead of adding the new upcall. | 304 | * to that upcall instead of adding the new upcall. |
305 | */ | 305 | */ |
306 | static inline struct gss_upcall_msg * | 306 | static inline struct gss_upcall_msg * |
307 | gss_add_msg(struct gss_auth *gss_auth, struct gss_upcall_msg *gss_msg) | 307 | gss_add_msg(struct gss_upcall_msg *gss_msg) |
308 | { | 308 | { |
309 | struct rpc_inode *rpci = gss_msg->inode; | 309 | struct rpc_inode *rpci = gss_msg->inode; |
310 | struct inode *inode = &rpci->vfs_inode; | 310 | struct inode *inode = &rpci->vfs_inode; |
@@ -445,7 +445,7 @@ gss_setup_upcall(struct rpc_clnt *clnt, struct gss_auth *gss_auth, struct rpc_cr | |||
445 | gss_new = gss_alloc_msg(gss_auth, uid, clnt, gss_cred->gc_machine_cred); | 445 | gss_new = gss_alloc_msg(gss_auth, uid, clnt, gss_cred->gc_machine_cred); |
446 | if (IS_ERR(gss_new)) | 446 | if (IS_ERR(gss_new)) |
447 | return gss_new; | 447 | return gss_new; |
448 | gss_msg = gss_add_msg(gss_auth, gss_new); | 448 | gss_msg = gss_add_msg(gss_new); |
449 | if (gss_msg == gss_new) { | 449 | if (gss_msg == gss_new) { |
450 | struct inode *inode = &gss_new->inode->vfs_inode; | 450 | struct inode *inode = &gss_new->inode->vfs_inode; |
451 | int res = rpc_queue_upcall(inode, &gss_new->msg); | 451 | int res = rpc_queue_upcall(inode, &gss_new->msg); |
@@ -485,7 +485,7 @@ gss_refresh_upcall(struct rpc_task *task) | |||
485 | dprintk("RPC: %5u gss_refresh_upcall for uid %u\n", task->tk_pid, | 485 | dprintk("RPC: %5u gss_refresh_upcall for uid %u\n", task->tk_pid, |
486 | cred->cr_uid); | 486 | cred->cr_uid); |
487 | gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred); | 487 | gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred); |
488 | if (IS_ERR(gss_msg) == -EAGAIN) { | 488 | if (PTR_ERR(gss_msg) == -EAGAIN) { |
489 | /* XXX: warning on the first, under the assumption we | 489 | /* XXX: warning on the first, under the assumption we |
490 | * shouldn't normally hit this case on a refresh. */ | 490 | * shouldn't normally hit this case on a refresh. */ |
491 | warn_gssd(); | 491 | warn_gssd(); |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 38829e20500b..154034b675bd 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -79,7 +79,7 @@ static void call_connect_status(struct rpc_task *task); | |||
79 | 79 | ||
80 | static __be32 *rpc_encode_header(struct rpc_task *task); | 80 | static __be32 *rpc_encode_header(struct rpc_task *task); |
81 | static __be32 *rpc_verify_header(struct rpc_task *task); | 81 | static __be32 *rpc_verify_header(struct rpc_task *task); |
82 | static int rpc_ping(struct rpc_clnt *clnt, int flags); | 82 | static int rpc_ping(struct rpc_clnt *clnt); |
83 | 83 | ||
84 | static void rpc_register_client(struct rpc_clnt *clnt) | 84 | static void rpc_register_client(struct rpc_clnt *clnt) |
85 | { | 85 | { |
@@ -340,7 +340,7 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) | |||
340 | return clnt; | 340 | return clnt; |
341 | 341 | ||
342 | if (!(args->flags & RPC_CLNT_CREATE_NOPING)) { | 342 | if (!(args->flags & RPC_CLNT_CREATE_NOPING)) { |
343 | int err = rpc_ping(clnt, RPC_TASK_SOFT); | 343 | int err = rpc_ping(clnt); |
344 | if (err != 0) { | 344 | if (err != 0) { |
345 | rpc_shutdown_client(clnt); | 345 | rpc_shutdown_client(clnt); |
346 | return ERR_PTR(err); | 346 | return ERR_PTR(err); |
@@ -528,7 +528,7 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old, | |||
528 | clnt->cl_prog = program->number; | 528 | clnt->cl_prog = program->number; |
529 | clnt->cl_vers = version->number; | 529 | clnt->cl_vers = version->number; |
530 | clnt->cl_stats = program->stats; | 530 | clnt->cl_stats = program->stats; |
531 | err = rpc_ping(clnt, RPC_TASK_SOFT); | 531 | err = rpc_ping(clnt); |
532 | if (err != 0) { | 532 | if (err != 0) { |
533 | rpc_shutdown_client(clnt); | 533 | rpc_shutdown_client(clnt); |
534 | clnt = ERR_PTR(err); | 534 | clnt = ERR_PTR(err); |
@@ -1060,7 +1060,7 @@ call_bind_status(struct rpc_task *task) | |||
1060 | goto retry_timeout; | 1060 | goto retry_timeout; |
1061 | case -EPFNOSUPPORT: | 1061 | case -EPFNOSUPPORT: |
1062 | /* server doesn't support any rpcbind version we know of */ | 1062 | /* server doesn't support any rpcbind version we know of */ |
1063 | dprintk("RPC: %5u remote rpcbind service unavailable\n", | 1063 | dprintk("RPC: %5u unrecognized remote rpcbind service\n", |
1064 | task->tk_pid); | 1064 | task->tk_pid); |
1065 | break; | 1065 | break; |
1066 | case -EPROTONOSUPPORT: | 1066 | case -EPROTONOSUPPORT: |
@@ -1069,6 +1069,21 @@ call_bind_status(struct rpc_task *task) | |||
1069 | task->tk_status = 0; | 1069 | task->tk_status = 0; |
1070 | task->tk_action = call_bind; | 1070 | task->tk_action = call_bind; |
1071 | return; | 1071 | return; |
1072 | case -ECONNREFUSED: /* connection problems */ | ||
1073 | case -ECONNRESET: | ||
1074 | case -ENOTCONN: | ||
1075 | case -EHOSTDOWN: | ||
1076 | case -EHOSTUNREACH: | ||
1077 | case -ENETUNREACH: | ||
1078 | case -EPIPE: | ||
1079 | dprintk("RPC: %5u remote rpcbind unreachable: %d\n", | ||
1080 | task->tk_pid, task->tk_status); | ||
1081 | if (!RPC_IS_SOFTCONN(task)) { | ||
1082 | rpc_delay(task, 5*HZ); | ||
1083 | goto retry_timeout; | ||
1084 | } | ||
1085 | status = task->tk_status; | ||
1086 | break; | ||
1072 | default: | 1087 | default: |
1073 | dprintk("RPC: %5u unrecognized rpcbind error (%d)\n", | 1088 | dprintk("RPC: %5u unrecognized rpcbind error (%d)\n", |
1074 | task->tk_pid, -task->tk_status); | 1089 | task->tk_pid, -task->tk_status); |
@@ -1180,11 +1195,25 @@ static void | |||
1180 | call_transmit_status(struct rpc_task *task) | 1195 | call_transmit_status(struct rpc_task *task) |
1181 | { | 1196 | { |
1182 | task->tk_action = call_status; | 1197 | task->tk_action = call_status; |
1198 | |||
1199 | /* | ||
1200 | * Common case: success. Force the compiler to put this | ||
1201 | * test first. | ||
1202 | */ | ||
1203 | if (task->tk_status == 0) { | ||
1204 | xprt_end_transmit(task); | ||
1205 | rpc_task_force_reencode(task); | ||
1206 | return; | ||
1207 | } | ||
1208 | |||
1183 | switch (task->tk_status) { | 1209 | switch (task->tk_status) { |
1184 | case -EAGAIN: | 1210 | case -EAGAIN: |
1185 | break; | 1211 | break; |
1186 | default: | 1212 | default: |
1213 | dprint_status(task); | ||
1187 | xprt_end_transmit(task); | 1214 | xprt_end_transmit(task); |
1215 | rpc_task_force_reencode(task); | ||
1216 | break; | ||
1188 | /* | 1217 | /* |
1189 | * Special cases: if we've been waiting on the | 1218 | * Special cases: if we've been waiting on the |
1190 | * socket's write_space() callback, or if the | 1219 | * socket's write_space() callback, or if the |
@@ -1192,11 +1221,16 @@ call_transmit_status(struct rpc_task *task) | |||
1192 | * then hold onto the transport lock. | 1221 | * then hold onto the transport lock. |
1193 | */ | 1222 | */ |
1194 | case -ECONNREFUSED: | 1223 | case -ECONNREFUSED: |
1195 | case -ECONNRESET: | ||
1196 | case -ENOTCONN: | ||
1197 | case -EHOSTDOWN: | 1224 | case -EHOSTDOWN: |
1198 | case -EHOSTUNREACH: | 1225 | case -EHOSTUNREACH: |
1199 | case -ENETUNREACH: | 1226 | case -ENETUNREACH: |
1227 | if (RPC_IS_SOFTCONN(task)) { | ||
1228 | xprt_end_transmit(task); | ||
1229 | rpc_exit(task, task->tk_status); | ||
1230 | break; | ||
1231 | } | ||
1232 | case -ECONNRESET: | ||
1233 | case -ENOTCONN: | ||
1200 | case -EPIPE: | 1234 | case -EPIPE: |
1201 | rpc_task_force_reencode(task); | 1235 | rpc_task_force_reencode(task); |
1202 | } | 1236 | } |
@@ -1346,6 +1380,10 @@ call_timeout(struct rpc_task *task) | |||
1346 | dprintk("RPC: %5u call_timeout (major)\n", task->tk_pid); | 1380 | dprintk("RPC: %5u call_timeout (major)\n", task->tk_pid); |
1347 | task->tk_timeouts++; | 1381 | task->tk_timeouts++; |
1348 | 1382 | ||
1383 | if (RPC_IS_SOFTCONN(task)) { | ||
1384 | rpc_exit(task, -ETIMEDOUT); | ||
1385 | return; | ||
1386 | } | ||
1349 | if (RPC_IS_SOFT(task)) { | 1387 | if (RPC_IS_SOFT(task)) { |
1350 | if (clnt->cl_chatty) | 1388 | if (clnt->cl_chatty) |
1351 | printk(KERN_NOTICE "%s: server %s not responding, timed out\n", | 1389 | printk(KERN_NOTICE "%s: server %s not responding, timed out\n", |
@@ -1675,14 +1713,14 @@ static struct rpc_procinfo rpcproc_null = { | |||
1675 | .p_decode = rpcproc_decode_null, | 1713 | .p_decode = rpcproc_decode_null, |
1676 | }; | 1714 | }; |
1677 | 1715 | ||
1678 | static int rpc_ping(struct rpc_clnt *clnt, int flags) | 1716 | static int rpc_ping(struct rpc_clnt *clnt) |
1679 | { | 1717 | { |
1680 | struct rpc_message msg = { | 1718 | struct rpc_message msg = { |
1681 | .rpc_proc = &rpcproc_null, | 1719 | .rpc_proc = &rpcproc_null, |
1682 | }; | 1720 | }; |
1683 | int err; | 1721 | int err; |
1684 | msg.rpc_cred = authnull_ops.lookup_cred(NULL, NULL, 0); | 1722 | msg.rpc_cred = authnull_ops.lookup_cred(NULL, NULL, 0); |
1685 | err = rpc_call_sync(clnt, &msg, flags); | 1723 | err = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT | RPC_TASK_SOFTCONN); |
1686 | put_rpccred(msg.rpc_cred); | 1724 | put_rpccred(msg.rpc_cred); |
1687 | return err; | 1725 | return err; |
1688 | } | 1726 | } |
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 830faf4d9997..3e3772d8eb92 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/in6.h> | 20 | #include <linux/in6.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <linux/mutex.h> | ||
23 | #include <net/ipv6.h> | 24 | #include <net/ipv6.h> |
24 | 25 | ||
25 | #include <linux/sunrpc/clnt.h> | 26 | #include <linux/sunrpc/clnt.h> |
@@ -110,6 +111,9 @@ static void rpcb_getport_done(struct rpc_task *, void *); | |||
110 | static void rpcb_map_release(void *data); | 111 | static void rpcb_map_release(void *data); |
111 | static struct rpc_program rpcb_program; | 112 | static struct rpc_program rpcb_program; |
112 | 113 | ||
114 | static struct rpc_clnt * rpcb_local_clnt; | ||
115 | static struct rpc_clnt * rpcb_local_clnt4; | ||
116 | |||
113 | struct rpcbind_args { | 117 | struct rpcbind_args { |
114 | struct rpc_xprt * r_xprt; | 118 | struct rpc_xprt * r_xprt; |
115 | 119 | ||
@@ -163,21 +167,60 @@ static const struct sockaddr_in rpcb_inaddr_loopback = { | |||
163 | .sin_port = htons(RPCBIND_PORT), | 167 | .sin_port = htons(RPCBIND_PORT), |
164 | }; | 168 | }; |
165 | 169 | ||
166 | static struct rpc_clnt *rpcb_create_local(struct sockaddr *addr, | 170 | static DEFINE_MUTEX(rpcb_create_local_mutex); |
167 | size_t addrlen, u32 version) | 171 | |
172 | /* | ||
173 | * Returns zero on success, otherwise a negative errno value | ||
174 | * is returned. | ||
175 | */ | ||
176 | static int rpcb_create_local(void) | ||
168 | { | 177 | { |
169 | struct rpc_create_args args = { | 178 | struct rpc_create_args args = { |
170 | .protocol = XPRT_TRANSPORT_UDP, | 179 | .protocol = XPRT_TRANSPORT_TCP, |
171 | .address = addr, | 180 | .address = (struct sockaddr *)&rpcb_inaddr_loopback, |
172 | .addrsize = addrlen, | 181 | .addrsize = sizeof(rpcb_inaddr_loopback), |
173 | .servername = "localhost", | 182 | .servername = "localhost", |
174 | .program = &rpcb_program, | 183 | .program = &rpcb_program, |
175 | .version = version, | 184 | .version = RPCBVERS_2, |
176 | .authflavor = RPC_AUTH_UNIX, | 185 | .authflavor = RPC_AUTH_UNIX, |
177 | .flags = RPC_CLNT_CREATE_NOPING, | 186 | .flags = RPC_CLNT_CREATE_NOPING, |
178 | }; | 187 | }; |
188 | struct rpc_clnt *clnt, *clnt4; | ||
189 | int result = 0; | ||
190 | |||
191 | if (rpcb_local_clnt) | ||
192 | return result; | ||
193 | |||
194 | mutex_lock(&rpcb_create_local_mutex); | ||
195 | if (rpcb_local_clnt) | ||
196 | goto out; | ||
197 | |||
198 | clnt = rpc_create(&args); | ||
199 | if (IS_ERR(clnt)) { | ||
200 | dprintk("RPC: failed to create local rpcbind " | ||
201 | "client (errno %ld).\n", PTR_ERR(clnt)); | ||
202 | result = -PTR_ERR(clnt); | ||
203 | goto out; | ||
204 | } | ||
179 | 205 | ||
180 | return rpc_create(&args); | 206 | /* |
207 | * This results in an RPC ping. On systems running portmapper, | ||
208 | * the v4 ping will fail. Proceed anyway, but disallow rpcb | ||
209 | * v4 upcalls. | ||
210 | */ | ||
211 | clnt4 = rpc_bind_new_program(clnt, &rpcb_program, RPCBVERS_4); | ||
212 | if (IS_ERR(clnt4)) { | ||
213 | dprintk("RPC: failed to create local rpcbind v4 " | ||
214 | "cleint (errno %ld).\n", PTR_ERR(clnt4)); | ||
215 | clnt4 = NULL; | ||
216 | } | ||
217 | |||
218 | rpcb_local_clnt = clnt; | ||
219 | rpcb_local_clnt4 = clnt4; | ||
220 | |||
221 | out: | ||
222 | mutex_unlock(&rpcb_create_local_mutex); | ||
223 | return result; | ||
181 | } | 224 | } |
182 | 225 | ||
183 | static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, | 226 | static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, |
@@ -209,22 +252,13 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, | |||
209 | return rpc_create(&args); | 252 | return rpc_create(&args); |
210 | } | 253 | } |
211 | 254 | ||
212 | static int rpcb_register_call(const u32 version, struct rpc_message *msg) | 255 | static int rpcb_register_call(struct rpc_clnt *clnt, struct rpc_message *msg) |
213 | { | 256 | { |
214 | struct sockaddr *addr = (struct sockaddr *)&rpcb_inaddr_loopback; | ||
215 | size_t addrlen = sizeof(rpcb_inaddr_loopback); | ||
216 | struct rpc_clnt *rpcb_clnt; | ||
217 | int result, error = 0; | 257 | int result, error = 0; |
218 | 258 | ||
219 | msg->rpc_resp = &result; | 259 | msg->rpc_resp = &result; |
220 | 260 | ||
221 | rpcb_clnt = rpcb_create_local(addr, addrlen, version); | 261 | error = rpc_call_sync(clnt, msg, RPC_TASK_SOFTCONN); |
222 | if (!IS_ERR(rpcb_clnt)) { | ||
223 | error = rpc_call_sync(rpcb_clnt, msg, 0); | ||
224 | rpc_shutdown_client(rpcb_clnt); | ||
225 | } else | ||
226 | error = PTR_ERR(rpcb_clnt); | ||
227 | |||
228 | if (error < 0) { | 262 | if (error < 0) { |
229 | dprintk("RPC: failed to contact local rpcbind " | 263 | dprintk("RPC: failed to contact local rpcbind " |
230 | "server (errno %d).\n", -error); | 264 | "server (errno %d).\n", -error); |
@@ -279,6 +313,11 @@ int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port) | |||
279 | struct rpc_message msg = { | 313 | struct rpc_message msg = { |
280 | .rpc_argp = &map, | 314 | .rpc_argp = &map, |
281 | }; | 315 | }; |
316 | int error; | ||
317 | |||
318 | error = rpcb_create_local(); | ||
319 | if (error) | ||
320 | return error; | ||
282 | 321 | ||
283 | dprintk("RPC: %sregistering (%u, %u, %d, %u) with local " | 322 | dprintk("RPC: %sregistering (%u, %u, %d, %u) with local " |
284 | "rpcbind\n", (port ? "" : "un"), | 323 | "rpcbind\n", (port ? "" : "un"), |
@@ -288,7 +327,7 @@ int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port) | |||
288 | if (port) | 327 | if (port) |
289 | msg.rpc_proc = &rpcb_procedures2[RPCBPROC_SET]; | 328 | msg.rpc_proc = &rpcb_procedures2[RPCBPROC_SET]; |
290 | 329 | ||
291 | return rpcb_register_call(RPCBVERS_2, &msg); | 330 | return rpcb_register_call(rpcb_local_clnt, &msg); |
292 | } | 331 | } |
293 | 332 | ||
294 | /* | 333 | /* |
@@ -313,7 +352,7 @@ static int rpcb_register_inet4(const struct sockaddr *sap, | |||
313 | if (port) | 352 | if (port) |
314 | msg->rpc_proc = &rpcb_procedures4[RPCBPROC_SET]; | 353 | msg->rpc_proc = &rpcb_procedures4[RPCBPROC_SET]; |
315 | 354 | ||
316 | result = rpcb_register_call(RPCBVERS_4, msg); | 355 | result = rpcb_register_call(rpcb_local_clnt4, msg); |
317 | kfree(map->r_addr); | 356 | kfree(map->r_addr); |
318 | return result; | 357 | return result; |
319 | } | 358 | } |
@@ -340,7 +379,7 @@ static int rpcb_register_inet6(const struct sockaddr *sap, | |||
340 | if (port) | 379 | if (port) |
341 | msg->rpc_proc = &rpcb_procedures4[RPCBPROC_SET]; | 380 | msg->rpc_proc = &rpcb_procedures4[RPCBPROC_SET]; |
342 | 381 | ||
343 | result = rpcb_register_call(RPCBVERS_4, msg); | 382 | result = rpcb_register_call(rpcb_local_clnt4, msg); |
344 | kfree(map->r_addr); | 383 | kfree(map->r_addr); |
345 | return result; | 384 | return result; |
346 | } | 385 | } |
@@ -356,7 +395,7 @@ static int rpcb_unregister_all_protofamilies(struct rpc_message *msg) | |||
356 | map->r_addr = ""; | 395 | map->r_addr = ""; |
357 | msg->rpc_proc = &rpcb_procedures4[RPCBPROC_UNSET]; | 396 | msg->rpc_proc = &rpcb_procedures4[RPCBPROC_UNSET]; |
358 | 397 | ||
359 | return rpcb_register_call(RPCBVERS_4, msg); | 398 | return rpcb_register_call(rpcb_local_clnt4, msg); |
360 | } | 399 | } |
361 | 400 | ||
362 | /** | 401 | /** |
@@ -414,6 +453,13 @@ int rpcb_v4_register(const u32 program, const u32 version, | |||
414 | struct rpc_message msg = { | 453 | struct rpc_message msg = { |
415 | .rpc_argp = &map, | 454 | .rpc_argp = &map, |
416 | }; | 455 | }; |
456 | int error; | ||
457 | |||
458 | error = rpcb_create_local(); | ||
459 | if (error) | ||
460 | return error; | ||
461 | if (rpcb_local_clnt4 == NULL) | ||
462 | return -EPROTONOSUPPORT; | ||
417 | 463 | ||
418 | if (address == NULL) | 464 | if (address == NULL) |
419 | return rpcb_unregister_all_protofamilies(&msg); | 465 | return rpcb_unregister_all_protofamilies(&msg); |
@@ -491,7 +537,7 @@ static struct rpc_task *rpcb_call_async(struct rpc_clnt *rpcb_clnt, struct rpcbi | |||
491 | .rpc_message = &msg, | 537 | .rpc_message = &msg, |
492 | .callback_ops = &rpcb_getport_ops, | 538 | .callback_ops = &rpcb_getport_ops, |
493 | .callback_data = map, | 539 | .callback_data = map, |
494 | .flags = RPC_TASK_ASYNC, | 540 | .flags = RPC_TASK_ASYNC | RPC_TASK_SOFTCONN, |
495 | }; | 541 | }; |
496 | 542 | ||
497 | return rpc_run_task(&task_setup_data); | 543 | return rpc_run_task(&task_setup_data); |
@@ -1027,3 +1073,15 @@ static struct rpc_program rpcb_program = { | |||
1027 | .version = rpcb_version, | 1073 | .version = rpcb_version, |
1028 | .stats = &rpcb_stats, | 1074 | .stats = &rpcb_stats, |
1029 | }; | 1075 | }; |
1076 | |||
1077 | /** | ||
1078 | * cleanup_rpcb_clnt - remove xprtsock's sysctls, unregister | ||
1079 | * | ||
1080 | */ | ||
1081 | void cleanup_rpcb_clnt(void) | ||
1082 | { | ||
1083 | if (rpcb_local_clnt4) | ||
1084 | rpc_shutdown_client(rpcb_local_clnt4); | ||
1085 | if (rpcb_local_clnt) | ||
1086 | rpc_shutdown_client(rpcb_local_clnt); | ||
1087 | } | ||
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 8cce92189019..f438347d817b 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | extern struct cache_detail ip_map_cache, unix_gid_cache; | 25 | extern struct cache_detail ip_map_cache, unix_gid_cache; |
26 | 26 | ||
27 | extern void cleanup_rpcb_clnt(void); | ||
28 | |||
27 | static int __init | 29 | static int __init |
28 | init_sunrpc(void) | 30 | init_sunrpc(void) |
29 | { | 31 | { |
@@ -53,6 +55,7 @@ out: | |||
53 | static void __exit | 55 | static void __exit |
54 | cleanup_sunrpc(void) | 56 | cleanup_sunrpc(void) |
55 | { | 57 | { |
58 | cleanup_rpcb_clnt(); | ||
56 | rpcauth_remove_module(); | 59 | rpcauth_remove_module(); |
57 | cleanup_socket_xprt(); | 60 | cleanup_socket_xprt(); |
58 | svc_cleanup_xprt_sock(); | 61 | svc_cleanup_xprt_sock(); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index fd46d42afa89..469de292c23c 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -700,6 +700,10 @@ void xprt_connect(struct rpc_task *task) | |||
700 | } | 700 | } |
701 | if (!xprt_lock_write(xprt, task)) | 701 | if (!xprt_lock_write(xprt, task)) |
702 | return; | 702 | return; |
703 | |||
704 | if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state)) | ||
705 | xprt->ops->close(xprt); | ||
706 | |||
703 | if (xprt_connected(xprt)) | 707 | if (xprt_connected(xprt)) |
704 | xprt_release_write(xprt, task); | 708 | xprt_release_write(xprt, task); |
705 | else { | 709 | else { |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 04732d09013e..3d739e5d15d8 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -2019,7 +2019,7 @@ static void xs_connect(struct rpc_task *task) | |||
2019 | if (xprt_test_and_set_connecting(xprt)) | 2019 | if (xprt_test_and_set_connecting(xprt)) |
2020 | return; | 2020 | return; |
2021 | 2021 | ||
2022 | if (transport->sock != NULL) { | 2022 | if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) { |
2023 | dprintk("RPC: xs_connect delayed xprt %p for %lu " | 2023 | dprintk("RPC: xs_connect delayed xprt %p for %lu " |
2024 | "seconds\n", | 2024 | "seconds\n", |
2025 | xprt, xprt->reestablish_timeout / HZ); | 2025 | xprt, xprt->reestablish_timeout / HZ); |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index c01470e7de15..baa898add287 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -141,62 +141,35 @@ static const struct ieee80211_regdomain us_regdom = { | |||
141 | .reg_rules = { | 141 | .reg_rules = { |
142 | /* IEEE 802.11b/g, channels 1..11 */ | 142 | /* IEEE 802.11b/g, channels 1..11 */ |
143 | REG_RULE(2412-10, 2462+10, 40, 6, 27, 0), | 143 | REG_RULE(2412-10, 2462+10, 40, 6, 27, 0), |
144 | /* IEEE 802.11a, channel 36 */ | 144 | /* IEEE 802.11a, channel 36..48 */ |
145 | REG_RULE(5180-10, 5180+10, 40, 6, 23, 0), | 145 | REG_RULE(5180-10, 5240+10, 40, 6, 17, 0), |
146 | /* IEEE 802.11a, channel 40 */ | ||
147 | REG_RULE(5200-10, 5200+10, 40, 6, 23, 0), | ||
148 | /* IEEE 802.11a, channel 44 */ | ||
149 | REG_RULE(5220-10, 5220+10, 40, 6, 23, 0), | ||
150 | /* IEEE 802.11a, channels 48..64 */ | 146 | /* IEEE 802.11a, channels 48..64 */ |
151 | REG_RULE(5240-10, 5320+10, 40, 6, 23, 0), | 147 | REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_DFS), |
148 | /* IEEE 802.11a, channels 100..124 */ | ||
149 | REG_RULE(5500-10, 5590+10, 40, 6, 20, NL80211_RRF_DFS), | ||
150 | /* IEEE 802.11a, channels 132..144 */ | ||
151 | REG_RULE(5660-10, 5700+10, 40, 6, 20, NL80211_RRF_DFS), | ||
152 | /* IEEE 802.11a, channels 149..165, outdoor */ | 152 | /* IEEE 802.11a, channels 149..165, outdoor */ |
153 | REG_RULE(5745-10, 5825+10, 40, 6, 30, 0), | 153 | REG_RULE(5745-10, 5825+10, 40, 6, 30, 0), |
154 | } | 154 | } |
155 | }; | 155 | }; |
156 | 156 | ||
157 | static const struct ieee80211_regdomain jp_regdom = { | 157 | static const struct ieee80211_regdomain jp_regdom = { |
158 | .n_reg_rules = 3, | 158 | .n_reg_rules = 6, |
159 | .alpha2 = "JP", | 159 | .alpha2 = "JP", |
160 | .reg_rules = { | 160 | .reg_rules = { |
161 | /* IEEE 802.11b/g, channels 1..14 */ | 161 | /* IEEE 802.11b/g, channels 1..11 */ |
162 | REG_RULE(2412-10, 2484+10, 40, 6, 20, 0), | 162 | REG_RULE(2412-10, 2462+10, 40, 6, 20, 0), |
163 | /* IEEE 802.11a, channels 34..48 */ | 163 | /* IEEE 802.11b/g, channels 12..13 */ |
164 | REG_RULE(5170-10, 5240+10, 40, 6, 20, | 164 | REG_RULE(2467-10, 2472+10, 20, 6, 20, 0), |
165 | NL80211_RRF_PASSIVE_SCAN), | 165 | /* IEEE 802.11b/g, channel 14 */ |
166 | REG_RULE(2484-10, 2484+10, 20, 6, 20, NL80211_RRF_NO_OFDM), | ||
167 | /* IEEE 802.11a, channels 36..48 */ | ||
168 | REG_RULE(5180-10, 5240+10, 40, 6, 20, 0), | ||
166 | /* IEEE 802.11a, channels 52..64 */ | 169 | /* IEEE 802.11a, channels 52..64 */ |
167 | REG_RULE(5260-10, 5320+10, 40, 6, 20, | 170 | REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_DFS), |
168 | NL80211_RRF_NO_IBSS | | 171 | /* IEEE 802.11a, channels 100..144 */ |
169 | NL80211_RRF_DFS), | 172 | REG_RULE(5500-10, 5700+10, 40, 6, 23, NL80211_RRF_DFS), |
170 | } | ||
171 | }; | ||
172 | |||
173 | static const struct ieee80211_regdomain eu_regdom = { | ||
174 | .n_reg_rules = 6, | ||
175 | /* | ||
176 | * This alpha2 is bogus, we leave it here just for stupid | ||
177 | * backward compatibility | ||
178 | */ | ||
179 | .alpha2 = "EU", | ||
180 | .reg_rules = { | ||
181 | /* IEEE 802.11b/g, channels 1..13 */ | ||
182 | REG_RULE(2412-10, 2472+10, 40, 6, 20, 0), | ||
183 | /* IEEE 802.11a, channel 36 */ | ||
184 | REG_RULE(5180-10, 5180+10, 40, 6, 23, | ||
185 | NL80211_RRF_PASSIVE_SCAN), | ||
186 | /* IEEE 802.11a, channel 40 */ | ||
187 | REG_RULE(5200-10, 5200+10, 40, 6, 23, | ||
188 | NL80211_RRF_PASSIVE_SCAN), | ||
189 | /* IEEE 802.11a, channel 44 */ | ||
190 | REG_RULE(5220-10, 5220+10, 40, 6, 23, | ||
191 | NL80211_RRF_PASSIVE_SCAN), | ||
192 | /* IEEE 802.11a, channels 48..64 */ | ||
193 | REG_RULE(5240-10, 5320+10, 40, 6, 20, | ||
194 | NL80211_RRF_NO_IBSS | | ||
195 | NL80211_RRF_DFS), | ||
196 | /* IEEE 802.11a, channels 100..140 */ | ||
197 | REG_RULE(5500-10, 5700+10, 40, 6, 30, | ||
198 | NL80211_RRF_NO_IBSS | | ||
199 | NL80211_RRF_DFS), | ||
200 | } | 173 | } |
201 | }; | 174 | }; |
202 | 175 | ||
@@ -206,15 +179,17 @@ static const struct ieee80211_regdomain *static_regdom(char *alpha2) | |||
206 | return &us_regdom; | 179 | return &us_regdom; |
207 | if (alpha2[0] == 'J' && alpha2[1] == 'P') | 180 | if (alpha2[0] == 'J' && alpha2[1] == 'P') |
208 | return &jp_regdom; | 181 | return &jp_regdom; |
182 | /* Use world roaming rules for "EU", since it was a pseudo | ||
183 | domain anyway... */ | ||
209 | if (alpha2[0] == 'E' && alpha2[1] == 'U') | 184 | if (alpha2[0] == 'E' && alpha2[1] == 'U') |
210 | return &eu_regdom; | 185 | return &world_regdom; |
211 | /* Default, as per the old rules */ | 186 | /* Default, world roaming rules */ |
212 | return &us_regdom; | 187 | return &world_regdom; |
213 | } | 188 | } |
214 | 189 | ||
215 | static bool is_old_static_regdom(const struct ieee80211_regdomain *rd) | 190 | static bool is_old_static_regdom(const struct ieee80211_regdomain *rd) |
216 | { | 191 | { |
217 | if (rd == &us_regdom || rd == &jp_regdom || rd == &eu_regdom) | 192 | if (rd == &us_regdom || rd == &jp_regdom || rd == &world_regdom) |
218 | return true; | 193 | return true; |
219 | return false; | 194 | return false; |
220 | } | 195 | } |
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 584eb4826e02..54face3d4424 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -479,6 +479,7 @@ static int __cfg80211_set_encryption(struct cfg80211_registered_device *rdev, | |||
479 | } | 479 | } |
480 | err = rdev->ops->del_key(&rdev->wiphy, dev, idx, addr); | 480 | err = rdev->ops->del_key(&rdev->wiphy, dev, idx, addr); |
481 | } | 481 | } |
482 | wdev->wext.connect.privacy = false; | ||
482 | /* | 483 | /* |
483 | * Applications using wireless extensions expect to be | 484 | * Applications using wireless extensions expect to be |
484 | * able to delete keys that don't exist, so allow that. | 485 | * able to delete keys that don't exist, so allow that. |