diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/ipv4/tcp_minisocks.c | 1 | ||||
| -rw-r--r-- | net/ipv4/udp.c | 73 | ||||
| -rw-r--r-- | net/mac80211/ibss.c | 4 | ||||
| -rw-r--r-- | net/mac80211/rx.c | 12 | ||||
| -rw-r--r-- | net/mac80211/sta_info.c | 2 | ||||
| -rw-r--r-- | net/mac80211/tx.c | 3 | ||||
| -rw-r--r-- | net/mac80211/util.c | 4 | ||||
| -rw-r--r-- | net/sched/act_pedit.c | 2 | ||||
| -rw-r--r-- | net/sched/cls_api.c | 2 | ||||
| -rw-r--r-- | net/wireless/nl80211.c | 3 |
10 files changed, 66 insertions, 40 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 624c3c9b3c2b..e320afea07fc 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
| @@ -644,6 +644,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, | |||
| 644 | /* If TCP_DEFER_ACCEPT is set, drop bare ACK. */ | 644 | /* If TCP_DEFER_ACCEPT is set, drop bare ACK. */ |
| 645 | if (inet_csk(sk)->icsk_accept_queue.rskq_defer_accept && | 645 | if (inet_csk(sk)->icsk_accept_queue.rskq_defer_accept && |
| 646 | TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) { | 646 | TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) { |
| 647 | inet_csk(sk)->icsk_accept_queue.rskq_defer_accept--; | ||
| 647 | inet_rsk(req)->acked = 1; | 648 | inet_rsk(req)->acked = 1; |
| 648 | return NULL; | 649 | return NULL; |
| 649 | } | 650 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 6ec6a8a4a224..d0d436d6216c 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -841,6 +841,42 @@ out: | |||
| 841 | return ret; | 841 | return ret; |
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | |||
| 845 | /** | ||
| 846 | * first_packet_length - return length of first packet in receive queue | ||
| 847 | * @sk: socket | ||
| 848 | * | ||
| 849 | * Drops all bad checksum frames, until a valid one is found. | ||
| 850 | * Returns the length of found skb, or 0 if none is found. | ||
| 851 | */ | ||
| 852 | static unsigned int first_packet_length(struct sock *sk) | ||
| 853 | { | ||
| 854 | struct sk_buff_head list_kill, *rcvq = &sk->sk_receive_queue; | ||
| 855 | struct sk_buff *skb; | ||
| 856 | unsigned int res; | ||
| 857 | |||
| 858 | __skb_queue_head_init(&list_kill); | ||
| 859 | |||
| 860 | spin_lock_bh(&rcvq->lock); | ||
| 861 | while ((skb = skb_peek(rcvq)) != NULL && | ||
| 862 | udp_lib_checksum_complete(skb)) { | ||
| 863 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, | ||
| 864 | IS_UDPLITE(sk)); | ||
| 865 | __skb_unlink(skb, rcvq); | ||
| 866 | __skb_queue_tail(&list_kill, skb); | ||
| 867 | } | ||
| 868 | res = skb ? skb->len : 0; | ||
| 869 | spin_unlock_bh(&rcvq->lock); | ||
| 870 | |||
| 871 | if (!skb_queue_empty(&list_kill)) { | ||
| 872 | lock_sock(sk); | ||
| 873 | __skb_queue_purge(&list_kill); | ||
| 874 | sk_mem_reclaim_partial(sk); | ||
| 875 | release_sock(sk); | ||
| 876 | } | ||
| 877 | return res; | ||
| 878 | } | ||
| 879 | |||
| 844 | /* | 880 | /* |
| 845 | * IOCTL requests applicable to the UDP protocol | 881 | * IOCTL requests applicable to the UDP protocol |
| 846 | */ | 882 | */ |
| @@ -857,21 +893,16 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg) | |||
| 857 | 893 | ||
| 858 | case SIOCINQ: | 894 | case SIOCINQ: |
| 859 | { | 895 | { |
| 860 | struct sk_buff *skb; | 896 | unsigned int amount = first_packet_length(sk); |
| 861 | unsigned long amount; | ||
| 862 | 897 | ||
| 863 | amount = 0; | 898 | if (amount) |
| 864 | spin_lock_bh(&sk->sk_receive_queue.lock); | ||
| 865 | skb = skb_peek(&sk->sk_receive_queue); | ||
| 866 | if (skb != NULL) { | ||
| 867 | /* | 899 | /* |
| 868 | * We will only return the amount | 900 | * We will only return the amount |
| 869 | * of this packet since that is all | 901 | * of this packet since that is all |
| 870 | * that will be read. | 902 | * that will be read. |
| 871 | */ | 903 | */ |
| 872 | amount = skb->len - sizeof(struct udphdr); | 904 | amount -= sizeof(struct udphdr); |
| 873 | } | 905 | |
| 874 | spin_unlock_bh(&sk->sk_receive_queue.lock); | ||
| 875 | return put_user(amount, (int __user *)arg); | 906 | return put_user(amount, (int __user *)arg); |
| 876 | } | 907 | } |
| 877 | 908 | ||
| @@ -1540,29 +1571,11 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
| 1540 | { | 1571 | { |
| 1541 | unsigned int mask = datagram_poll(file, sock, wait); | 1572 | unsigned int mask = datagram_poll(file, sock, wait); |
| 1542 | struct sock *sk = sock->sk; | 1573 | struct sock *sk = sock->sk; |
| 1543 | int is_lite = IS_UDPLITE(sk); | ||
| 1544 | 1574 | ||
| 1545 | /* Check for false positives due to checksum errors */ | 1575 | /* Check for false positives due to checksum errors */ |
| 1546 | if ((mask & POLLRDNORM) && | 1576 | if ((mask & POLLRDNORM) && !(file->f_flags & O_NONBLOCK) && |
| 1547 | !(file->f_flags & O_NONBLOCK) && | 1577 | !(sk->sk_shutdown & RCV_SHUTDOWN) && !first_packet_length(sk)) |
| 1548 | !(sk->sk_shutdown & RCV_SHUTDOWN)) { | 1578 | mask &= ~(POLLIN | POLLRDNORM); |
| 1549 | struct sk_buff_head *rcvq = &sk->sk_receive_queue; | ||
| 1550 | struct sk_buff *skb; | ||
| 1551 | |||
| 1552 | spin_lock_bh(&rcvq->lock); | ||
| 1553 | while ((skb = skb_peek(rcvq)) != NULL && | ||
| 1554 | udp_lib_checksum_complete(skb)) { | ||
| 1555 | UDP_INC_STATS_BH(sock_net(sk), | ||
| 1556 | UDP_MIB_INERRORS, is_lite); | ||
| 1557 | __skb_unlink(skb, rcvq); | ||
| 1558 | kfree_skb(skb); | ||
| 1559 | } | ||
| 1560 | spin_unlock_bh(&rcvq->lock); | ||
| 1561 | |||
| 1562 | /* nothing to see, move along */ | ||
| 1563 | if (skb == NULL) | ||
| 1564 | mask &= ~(POLLIN | POLLRDNORM); | ||
| 1565 | } | ||
| 1566 | 1579 | ||
| 1567 | return mask; | 1580 | return mask; |
| 1568 | 1581 | ||
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 920ec8792f4b..6eaf69823439 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
| @@ -544,7 +544,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
| 544 | "%pM\n", bss->cbss.bssid, ifibss->bssid); | 544 | "%pM\n", bss->cbss.bssid, ifibss->bssid); |
| 545 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 545 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
| 546 | 546 | ||
| 547 | if (bss && memcmp(ifibss->bssid, bss->cbss.bssid, ETH_ALEN)) { | 547 | if (bss && !memcmp(ifibss->bssid, bss->cbss.bssid, ETH_ALEN)) { |
| 548 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM" | 548 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM" |
| 549 | " based on configured SSID\n", | 549 | " based on configured SSID\n", |
| 550 | sdata->dev->name, bss->cbss.bssid); | 550 | sdata->dev->name, bss->cbss.bssid); |
| @@ -829,7 +829,7 @@ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local) | |||
| 829 | if (!sdata->u.ibss.ssid_len) | 829 | if (!sdata->u.ibss.ssid_len) |
| 830 | continue; | 830 | continue; |
| 831 | sdata->u.ibss.last_scan_completed = jiffies; | 831 | sdata->u.ibss.last_scan_completed = jiffies; |
| 832 | ieee80211_sta_find_ibss(sdata); | 832 | mod_timer(&sdata->u.ibss.timer, 0); |
| 833 | } | 833 | } |
| 834 | mutex_unlock(&local->iflist_mtx); | 834 | mutex_unlock(&local->iflist_mtx); |
| 835 | } | 835 | } |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index c01588f9d453..7170bf4565a8 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -2164,11 +2164,17 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
| 2164 | 2164 | ||
| 2165 | skb = rx.skb; | 2165 | skb = rx.skb; |
| 2166 | 2166 | ||
| 2167 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 2167 | if (rx.sdata && ieee80211_is_data(hdr->frame_control)) { |
| 2168 | rx.flags |= IEEE80211_RX_RA_MATCH; | ||
| 2169 | prepares = prepare_for_handlers(rx.sdata, &rx, hdr); | ||
| 2170 | if (prepares) | ||
| 2171 | prev = rx.sdata; | ||
| 2172 | } else list_for_each_entry_rcu(sdata, &local->interfaces, list) { | ||
| 2168 | if (!netif_running(sdata->dev)) | 2173 | if (!netif_running(sdata->dev)) |
| 2169 | continue; | 2174 | continue; |
| 2170 | 2175 | ||
| 2171 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR) | 2176 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR || |
| 2177 | sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | ||
| 2172 | continue; | 2178 | continue; |
| 2173 | 2179 | ||
| 2174 | rx.flags |= IEEE80211_RX_RA_MATCH; | 2180 | rx.flags |= IEEE80211_RX_RA_MATCH; |
| @@ -2447,6 +2453,8 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
| 2447 | struct ieee80211_supported_band *sband; | 2453 | struct ieee80211_supported_band *sband; |
| 2448 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | 2454 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
| 2449 | 2455 | ||
| 2456 | WARN_ON_ONCE(softirq_count() == 0); | ||
| 2457 | |||
| 2450 | if (WARN_ON(status->band < 0 || | 2458 | if (WARN_ON(status->band < 0 || |
| 2451 | status->band >= IEEE80211_NUM_BANDS)) | 2459 | status->band >= IEEE80211_NUM_BANDS)) |
| 2452 | goto drop; | 2460 | goto drop; |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index eec001491e66..594f2318c3d8 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
| @@ -361,6 +361,7 @@ int sta_info_insert(struct sta_info *sta) | |||
| 361 | u.ap); | 361 | u.ap); |
| 362 | 362 | ||
| 363 | drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD, &sta->sta); | 363 | drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD, &sta->sta); |
| 364 | sdata = sta->sdata; | ||
| 364 | } | 365 | } |
| 365 | 366 | ||
| 366 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | 367 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
| @@ -496,6 +497,7 @@ static void __sta_info_unlink(struct sta_info **sta) | |||
| 496 | 497 | ||
| 497 | drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE, | 498 | drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE, |
| 498 | &(*sta)->sta); | 499 | &(*sta)->sta); |
| 500 | sdata = (*sta)->sdata; | ||
| 499 | } | 501 | } |
| 500 | 502 | ||
| 501 | if (ieee80211_vif_is_mesh(&sdata->vif)) { | 503 | if (ieee80211_vif_is_mesh(&sdata->vif)) { |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index fd4028296613..db4bda681ec9 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
| @@ -1704,7 +1704,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
| 1704 | if (!is_multicast_ether_addr(hdr.addr1)) { | 1704 | if (!is_multicast_ether_addr(hdr.addr1)) { |
| 1705 | rcu_read_lock(); | 1705 | rcu_read_lock(); |
| 1706 | sta = sta_info_get(local, hdr.addr1); | 1706 | sta = sta_info_get(local, hdr.addr1); |
| 1707 | if (sta) | 1707 | /* XXX: in the future, use sdata to look up the sta */ |
| 1708 | if (sta && sta->sdata == sdata) | ||
| 1708 | sta_flags = get_sta_flags(sta); | 1709 | sta_flags = get_sta_flags(sta); |
| 1709 | rcu_read_unlock(); | 1710 | rcu_read_unlock(); |
| 1710 | } | 1711 | } |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index dd6564321369..aeb65b3d2295 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
| @@ -339,7 +339,7 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local, | |||
| 339 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 339 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
| 340 | 340 | ||
| 341 | if (WARN_ON(!info->control.vif)) { | 341 | if (WARN_ON(!info->control.vif)) { |
| 342 | kfree(skb); | 342 | kfree_skb(skb); |
| 343 | return; | 343 | return; |
| 344 | } | 344 | } |
| 345 | 345 | ||
| @@ -367,7 +367,7 @@ int ieee80211_add_pending_skbs(struct ieee80211_local *local, | |||
| 367 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 367 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
| 368 | 368 | ||
| 369 | if (WARN_ON(!info->control.vif)) { | 369 | if (WARN_ON(!info->control.vif)) { |
| 370 | kfree(skb); | 370 | kfree_skb(skb); |
| 371 | continue; | 371 | continue; |
| 372 | } | 372 | } |
| 373 | 373 | ||
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 96c0ed115e2a..6b0359a500e6 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
| @@ -34,7 +34,7 @@ static struct tcf_hashinfo pedit_hash_info = { | |||
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = { | 36 | static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = { |
| 37 | [TCA_PEDIT_PARMS] = { .len = sizeof(struct tcf_pedit) }, | 37 | [TCA_PEDIT_PARMS] = { .len = sizeof(struct tc_pedit) }, |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | static int tcf_pedit_init(struct nlattr *nla, struct nlattr *est, | 40 | static int tcf_pedit_init(struct nlattr *nla, struct nlattr *est, |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 6a536949cdc0..7cf6c0fbc7a6 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
| @@ -350,7 +350,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, | |||
| 350 | tcm = NLMSG_DATA(nlh); | 350 | tcm = NLMSG_DATA(nlh); |
| 351 | tcm->tcm_family = AF_UNSPEC; | 351 | tcm->tcm_family = AF_UNSPEC; |
| 352 | tcm->tcm__pad1 = 0; | 352 | tcm->tcm__pad1 = 0; |
| 353 | tcm->tcm__pad1 = 0; | 353 | tcm->tcm__pad2 = 0; |
| 354 | tcm->tcm_ifindex = qdisc_dev(tp->q)->ifindex; | 354 | tcm->tcm_ifindex = qdisc_dev(tp->q)->ifindex; |
| 355 | tcm->tcm_parent = tp->classid; | 355 | tcm->tcm_parent = tp->classid; |
| 356 | tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol); | 356 | tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol); |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index eddab097435c..ca3c92a0a14f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -4029,7 +4029,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info) | |||
| 4029 | rdev = cfg80211_get_dev_from_info(info); | 4029 | rdev = cfg80211_get_dev_from_info(info); |
| 4030 | if (IS_ERR(rdev)) { | 4030 | if (IS_ERR(rdev)) { |
| 4031 | err = PTR_ERR(rdev); | 4031 | err = PTR_ERR(rdev); |
| 4032 | goto out; | 4032 | goto out_rtnl; |
| 4033 | } | 4033 | } |
| 4034 | 4034 | ||
| 4035 | net = get_net_ns_by_pid(pid); | 4035 | net = get_net_ns_by_pid(pid); |
| @@ -4049,6 +4049,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info) | |||
| 4049 | put_net(net); | 4049 | put_net(net); |
| 4050 | out: | 4050 | out: |
| 4051 | cfg80211_unlock_rdev(rdev); | 4051 | cfg80211_unlock_rdev(rdev); |
| 4052 | out_rtnl: | ||
| 4052 | rtnl_unlock(); | 4053 | rtnl_unlock(); |
| 4053 | return err; | 4054 | return err; |
| 4054 | } | 4055 | } |
