diff options
author | J. Bruce Fields <bfields@redhat.com> | 2015-02-02 11:29:29 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-02-02 11:29:29 -0500 |
commit | a584143b01ce69803116ae8d0a4db382acc728d7 (patch) | |
tree | 002733709647fa1e17683a9d21dbc23ae99e3d2d /net | |
parent | 4c94e13e9caed09103419c087f436d79f9d2faba (diff) | |
parent | 8116bf4cb62d337c953cfa5369ef4cf83e73140c (diff) |
Merge branch 'locks-3.20' of git://git.samba.org/jlayton/linux into for-3.20
Christoph's block pnfs patches have some minor dependencies on these
lock patches.
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/multicast.c | 11 | ||||
-rw-r--r-- | net/batman-adv/network-coding.c | 2 | ||||
-rw-r--r-- | net/batman-adv/originator.c | 7 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 6 | ||||
-rw-r--r-- | net/bridge/br_input.c | 3 | ||||
-rw-r--r-- | net/ceph/auth_x.c | 2 | ||||
-rw-r--r-- | net/ceph/mon_client.c | 2 | ||||
-rw-r--r-- | net/core/neighbour.c | 44 | ||||
-rw-r--r-- | net/ipv4/netfilter/nft_redir_ipv4.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 4 | ||||
-rw-r--r-- | net/ipv6/netfilter/nft_redir_ipv6.c | 8 | ||||
-rw-r--r-- | net/mac80211/key.c | 12 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ftp.c | 10 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 20 | ||||
-rw-r--r-- | net/netfilter/nf_tables_api.c | 14 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 5 | ||||
-rw-r--r-- | net/netfilter/nft_nat.c | 8 | ||||
-rw-r--r-- | net/openvswitch/datapath.c | 3 | ||||
-rw-r--r-- | net/openvswitch/flow.c | 5 | ||||
-rw-r--r-- | net/openvswitch/vport.c | 2 | ||||
-rw-r--r-- | net/packet/af_packet.c | 2 | ||||
-rw-r--r-- | net/tipc/bcast.c | 5 |
22 files changed, 123 insertions, 60 deletions
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c index ab6bb2af1d45..b24e4bb64fb5 100644 --- a/net/batman-adv/multicast.c +++ b/net/batman-adv/multicast.c | |||
@@ -685,11 +685,13 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv, | |||
685 | if (orig_initialized) | 685 | if (orig_initialized) |
686 | atomic_dec(&bat_priv->mcast.num_disabled); | 686 | atomic_dec(&bat_priv->mcast.num_disabled); |
687 | orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST; | 687 | orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST; |
688 | /* If mcast support is being switched off increase the disabled | 688 | /* If mcast support is being switched off or if this is an initial |
689 | * mcast node counter. | 689 | * OGM without mcast support then increase the disabled mcast |
690 | * node counter. | ||
690 | */ | 691 | */ |
691 | } else if (!orig_mcast_enabled && | 692 | } else if (!orig_mcast_enabled && |
692 | orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) { | 693 | (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST || |
694 | !orig_initialized)) { | ||
693 | atomic_inc(&bat_priv->mcast.num_disabled); | 695 | atomic_inc(&bat_priv->mcast.num_disabled); |
694 | orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST; | 696 | orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST; |
695 | } | 697 | } |
@@ -738,7 +740,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig) | |||
738 | { | 740 | { |
739 | struct batadv_priv *bat_priv = orig->bat_priv; | 741 | struct batadv_priv *bat_priv = orig->bat_priv; |
740 | 742 | ||
741 | if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST)) | 743 | if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) && |
744 | orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST) | ||
742 | atomic_dec(&bat_priv->mcast.num_disabled); | 745 | atomic_dec(&bat_priv->mcast.num_disabled); |
743 | 746 | ||
744 | batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS); | 747 | batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS); |
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c index 8d04d174669e..fab47f1f3ef9 100644 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c | |||
@@ -133,7 +133,7 @@ int batadv_nc_mesh_init(struct batadv_priv *bat_priv) | |||
133 | if (!bat_priv->nc.decoding_hash) | 133 | if (!bat_priv->nc.decoding_hash) |
134 | goto err; | 134 | goto err; |
135 | 135 | ||
136 | batadv_hash_set_lock_class(bat_priv->nc.coding_hash, | 136 | batadv_hash_set_lock_class(bat_priv->nc.decoding_hash, |
137 | &batadv_nc_decoding_hash_lock_class_key); | 137 | &batadv_nc_decoding_hash_lock_class_key); |
138 | 138 | ||
139 | INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); | 139 | INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); |
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 6a484514cd3e..bea8198d0198 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
@@ -570,9 +570,6 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu) | |||
570 | 570 | ||
571 | batadv_frag_purge_orig(orig_node, NULL); | 571 | batadv_frag_purge_orig(orig_node, NULL); |
572 | 572 | ||
573 | batadv_tt_global_del_orig(orig_node->bat_priv, orig_node, -1, | ||
574 | "originator timed out"); | ||
575 | |||
576 | if (orig_node->bat_priv->bat_algo_ops->bat_orig_free) | 573 | if (orig_node->bat_priv->bat_algo_ops->bat_orig_free) |
577 | orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node); | 574 | orig_node->bat_priv->bat_algo_ops->bat_orig_free(orig_node); |
578 | 575 | ||
@@ -678,6 +675,7 @@ struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv, | |||
678 | atomic_set(&orig_node->last_ttvn, 0); | 675 | atomic_set(&orig_node->last_ttvn, 0); |
679 | orig_node->tt_buff = NULL; | 676 | orig_node->tt_buff = NULL; |
680 | orig_node->tt_buff_len = 0; | 677 | orig_node->tt_buff_len = 0; |
678 | orig_node->last_seen = jiffies; | ||
681 | reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS); | 679 | reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS); |
682 | orig_node->bcast_seqno_reset = reset_time; | 680 | orig_node->bcast_seqno_reset = reset_time; |
683 | #ifdef CONFIG_BATMAN_ADV_MCAST | 681 | #ifdef CONFIG_BATMAN_ADV_MCAST |
@@ -977,6 +975,9 @@ static void _batadv_purge_orig(struct batadv_priv *bat_priv) | |||
977 | if (batadv_purge_orig_node(bat_priv, orig_node)) { | 975 | if (batadv_purge_orig_node(bat_priv, orig_node)) { |
978 | batadv_gw_node_delete(bat_priv, orig_node); | 976 | batadv_gw_node_delete(bat_priv, orig_node); |
979 | hlist_del_rcu(&orig_node->hash_entry); | 977 | hlist_del_rcu(&orig_node->hash_entry); |
978 | batadv_tt_global_del_orig(orig_node->bat_priv, | ||
979 | orig_node, -1, | ||
980 | "originator timed out"); | ||
980 | batadv_orig_node_free_ref(orig_node); | 981 | batadv_orig_node_free_ref(orig_node); |
981 | continue; | 982 | continue; |
982 | } | 983 | } |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 35f76f2f7824..6648f321864d 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -443,11 +443,13 @@ batadv_find_router(struct batadv_priv *bat_priv, | |||
443 | 443 | ||
444 | router = batadv_orig_router_get(orig_node, recv_if); | 444 | router = batadv_orig_router_get(orig_node, recv_if); |
445 | 445 | ||
446 | if (!router) | ||
447 | return router; | ||
448 | |||
446 | /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) | 449 | /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) |
447 | * and if activated. | 450 | * and if activated. |
448 | */ | 451 | */ |
449 | if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) || | 452 | if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding))) |
450 | !router) | ||
451 | return router; | 453 | return router; |
452 | 454 | ||
453 | /* bonding: loop through the list of possible routers found | 455 | /* bonding: loop through the list of possible routers found |
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 1f1de715197c..e2aa7be3a847 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
@@ -154,7 +154,8 @@ int br_handle_frame_finish(struct sk_buff *skb) | |||
154 | dst = NULL; | 154 | dst = NULL; |
155 | 155 | ||
156 | if (is_broadcast_ether_addr(dest)) { | 156 | if (is_broadcast_ether_addr(dest)) { |
157 | if (p->flags & BR_PROXYARP && | 157 | if (IS_ENABLED(CONFIG_INET) && |
158 | p->flags & BR_PROXYARP && | ||
158 | skb->protocol == htons(ETH_P_ARP)) | 159 | skb->protocol == htons(ETH_P_ARP)) |
159 | br_do_proxy_arp(skb, br, vid); | 160 | br_do_proxy_arp(skb, br, vid); |
160 | 161 | ||
diff --git a/net/ceph/auth_x.c b/net/ceph/auth_x.c index 15845814a0f2..ba6eb17226da 100644 --- a/net/ceph/auth_x.c +++ b/net/ceph/auth_x.c | |||
@@ -676,7 +676,7 @@ static int calcu_signature(struct ceph_x_authorizer *au, | |||
676 | int ret; | 676 | int ret; |
677 | char tmp_enc[40]; | 677 | char tmp_enc[40]; |
678 | __le32 tmp[5] = { | 678 | __le32 tmp[5] = { |
679 | 16u, msg->hdr.crc, msg->footer.front_crc, | 679 | cpu_to_le32(16), msg->hdr.crc, msg->footer.front_crc, |
680 | msg->footer.middle_crc, msg->footer.data_crc, | 680 | msg->footer.middle_crc, msg->footer.data_crc, |
681 | }; | 681 | }; |
682 | ret = ceph_x_encrypt(&au->session_key, &tmp, sizeof(tmp), | 682 | ret = ceph_x_encrypt(&au->session_key, &tmp, sizeof(tmp), |
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index a83062ceeec9..f2148e22b148 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c | |||
@@ -717,7 +717,7 @@ static int get_poolop_reply_buf(const char *src, size_t src_len, | |||
717 | if (src_len != sizeof(u32) + dst_len) | 717 | if (src_len != sizeof(u32) + dst_len) |
718 | return -EINVAL; | 718 | return -EINVAL; |
719 | 719 | ||
720 | buf_len = le32_to_cpu(*(u32 *)src); | 720 | buf_len = le32_to_cpu(*(__le32 *)src); |
721 | if (buf_len != dst_len) | 721 | if (buf_len != dst_len) |
722 | return -EINVAL; | 722 | return -EINVAL; |
723 | 723 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 8e38f17288d3..8d614c93f86a 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2043,6 +2043,12 @@ static int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
2043 | case NDTPA_BASE_REACHABLE_TIME: | 2043 | case NDTPA_BASE_REACHABLE_TIME: |
2044 | NEIGH_VAR_SET(p, BASE_REACHABLE_TIME, | 2044 | NEIGH_VAR_SET(p, BASE_REACHABLE_TIME, |
2045 | nla_get_msecs(tbp[i])); | 2045 | nla_get_msecs(tbp[i])); |
2046 | /* update reachable_time as well, otherwise, the change will | ||
2047 | * only be effective after the next time neigh_periodic_work | ||
2048 | * decides to recompute it (can be multiple minutes) | ||
2049 | */ | ||
2050 | p->reachable_time = | ||
2051 | neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME)); | ||
2046 | break; | 2052 | break; |
2047 | case NDTPA_GC_STALETIME: | 2053 | case NDTPA_GC_STALETIME: |
2048 | NEIGH_VAR_SET(p, GC_STALETIME, | 2054 | NEIGH_VAR_SET(p, GC_STALETIME, |
@@ -2921,6 +2927,31 @@ static int neigh_proc_dointvec_unres_qlen(struct ctl_table *ctl, int write, | |||
2921 | return ret; | 2927 | return ret; |
2922 | } | 2928 | } |
2923 | 2929 | ||
2930 | static int neigh_proc_base_reachable_time(struct ctl_table *ctl, int write, | ||
2931 | void __user *buffer, | ||
2932 | size_t *lenp, loff_t *ppos) | ||
2933 | { | ||
2934 | struct neigh_parms *p = ctl->extra2; | ||
2935 | int ret; | ||
2936 | |||
2937 | if (strcmp(ctl->procname, "base_reachable_time") == 0) | ||
2938 | ret = neigh_proc_dointvec_jiffies(ctl, write, buffer, lenp, ppos); | ||
2939 | else if (strcmp(ctl->procname, "base_reachable_time_ms") == 0) | ||
2940 | ret = neigh_proc_dointvec_ms_jiffies(ctl, write, buffer, lenp, ppos); | ||
2941 | else | ||
2942 | ret = -1; | ||
2943 | |||
2944 | if (write && ret == 0) { | ||
2945 | /* update reachable_time as well, otherwise, the change will | ||
2946 | * only be effective after the next time neigh_periodic_work | ||
2947 | * decides to recompute it | ||
2948 | */ | ||
2949 | p->reachable_time = | ||
2950 | neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME)); | ||
2951 | } | ||
2952 | return ret; | ||
2953 | } | ||
2954 | |||
2924 | #define NEIGH_PARMS_DATA_OFFSET(index) \ | 2955 | #define NEIGH_PARMS_DATA_OFFSET(index) \ |
2925 | (&((struct neigh_parms *) 0)->data[index]) | 2956 | (&((struct neigh_parms *) 0)->data[index]) |
2926 | 2957 | ||
@@ -3047,6 +3078,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | |||
3047 | t->neigh_vars[NEIGH_VAR_RETRANS_TIME_MS].proc_handler = handler; | 3078 | t->neigh_vars[NEIGH_VAR_RETRANS_TIME_MS].proc_handler = handler; |
3048 | /* ReachableTime (in milliseconds) */ | 3079 | /* ReachableTime (in milliseconds) */ |
3049 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME_MS].proc_handler = handler; | 3080 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME_MS].proc_handler = handler; |
3081 | } else { | ||
3082 | /* Those handlers will update p->reachable_time after | ||
3083 | * base_reachable_time(_ms) is set to ensure the new timer starts being | ||
3084 | * applied after the next neighbour update instead of waiting for | ||
3085 | * neigh_periodic_work to update its value (can be multiple minutes) | ||
3086 | * So any handler that replaces them should do this as well | ||
3087 | */ | ||
3088 | /* ReachableTime */ | ||
3089 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME].proc_handler = | ||
3090 | neigh_proc_base_reachable_time; | ||
3091 | /* ReachableTime (in milliseconds) */ | ||
3092 | t->neigh_vars[NEIGH_VAR_BASE_REACHABLE_TIME_MS].proc_handler = | ||
3093 | neigh_proc_base_reachable_time; | ||
3050 | } | 3094 | } |
3051 | 3095 | ||
3052 | /* Don't export sysctls to unprivileged users */ | 3096 | /* Don't export sysctls to unprivileged users */ |
diff --git a/net/ipv4/netfilter/nft_redir_ipv4.c b/net/ipv4/netfilter/nft_redir_ipv4.c index ff2d23d8c87a..6ecfce63201a 100644 --- a/net/ipv4/netfilter/nft_redir_ipv4.c +++ b/net/ipv4/netfilter/nft_redir_ipv4.c | |||
@@ -27,10 +27,10 @@ static void nft_redir_ipv4_eval(const struct nft_expr *expr, | |||
27 | 27 | ||
28 | memset(&mr, 0, sizeof(mr)); | 28 | memset(&mr, 0, sizeof(mr)); |
29 | if (priv->sreg_proto_min) { | 29 | if (priv->sreg_proto_min) { |
30 | mr.range[0].min.all = (__force __be16) | 30 | mr.range[0].min.all = |
31 | data[priv->sreg_proto_min].data[0]; | 31 | *(__be16 *)&data[priv->sreg_proto_min].data[0]; |
32 | mr.range[0].max.all = (__force __be16) | 32 | mr.range[0].max.all = |
33 | data[priv->sreg_proto_max].data[0]; | 33 | *(__be16 *)&data[priv->sreg_proto_max].data[0]; |
34 | mr.range[0].flags |= NF_NAT_RANGE_PROTO_SPECIFIED; | 34 | mr.range[0].flags |= NF_NAT_RANGE_PROTO_SPECIFIED; |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 7f18262e2326..65caf8b95e17 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2019,7 +2019,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, | |||
2019 | if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) | 2019 | if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) |
2020 | break; | 2020 | break; |
2021 | 2021 | ||
2022 | if (tso_segs == 1) { | 2022 | if (tso_segs == 1 || !max_segs) { |
2023 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, | 2023 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, |
2024 | (tcp_skb_is_last(sk, skb) ? | 2024 | (tcp_skb_is_last(sk, skb) ? |
2025 | nonagle : TCP_NAGLE_PUSH)))) | 2025 | nonagle : TCP_NAGLE_PUSH)))) |
@@ -2032,7 +2032,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, | |||
2032 | } | 2032 | } |
2033 | 2033 | ||
2034 | limit = mss_now; | 2034 | limit = mss_now; |
2035 | if (tso_segs > 1 && !tcp_urg_mode(tp)) | 2035 | if (tso_segs > 1 && max_segs && !tcp_urg_mode(tp)) |
2036 | limit = tcp_mss_split_point(sk, skb, mss_now, | 2036 | limit = tcp_mss_split_point(sk, skb, mss_now, |
2037 | min_t(unsigned int, | 2037 | min_t(unsigned int, |
2038 | cwnd_quota, | 2038 | cwnd_quota, |
diff --git a/net/ipv6/netfilter/nft_redir_ipv6.c b/net/ipv6/netfilter/nft_redir_ipv6.c index 2433a6bfb191..11820b6b3613 100644 --- a/net/ipv6/netfilter/nft_redir_ipv6.c +++ b/net/ipv6/netfilter/nft_redir_ipv6.c | |||
@@ -27,10 +27,10 @@ static void nft_redir_ipv6_eval(const struct nft_expr *expr, | |||
27 | 27 | ||
28 | memset(&range, 0, sizeof(range)); | 28 | memset(&range, 0, sizeof(range)); |
29 | if (priv->sreg_proto_min) { | 29 | if (priv->sreg_proto_min) { |
30 | range.min_proto.all = (__force __be16) | 30 | range.min_proto.all = |
31 | data[priv->sreg_proto_min].data[0]; | 31 | *(__be16 *)&data[priv->sreg_proto_min].data[0]; |
32 | range.max_proto.all = (__force __be16) | 32 | range.max_proto.all = |
33 | data[priv->sreg_proto_max].data[0]; | 33 | *(__be16 *)&data[priv->sreg_proto_max].data[0]; |
34 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; | 34 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 0bb7038121ac..bd4e46ec32bd 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -140,7 +140,9 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key) | |||
140 | if (!ret) { | 140 | if (!ret) { |
141 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; | 141 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; |
142 | 142 | ||
143 | if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | 143 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || |
144 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | ||
145 | (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | ||
144 | sdata->crypto_tx_tailroom_needed_cnt--; | 146 | sdata->crypto_tx_tailroom_needed_cnt--; |
145 | 147 | ||
146 | WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && | 148 | WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && |
@@ -188,7 +190,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) | |||
188 | sta = key->sta; | 190 | sta = key->sta; |
189 | sdata = key->sdata; | 191 | sdata = key->sdata; |
190 | 192 | ||
191 | if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | 193 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || |
194 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | ||
195 | (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | ||
192 | increment_tailroom_need_count(sdata); | 196 | increment_tailroom_need_count(sdata); |
193 | 197 | ||
194 | ret = drv_set_key(key->local, DISABLE_KEY, sdata, | 198 | ret = drv_set_key(key->local, DISABLE_KEY, sdata, |
@@ -884,7 +888,9 @@ void ieee80211_remove_key(struct ieee80211_key_conf *keyconf) | |||
884 | if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { | 888 | if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { |
885 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; | 889 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; |
886 | 890 | ||
887 | if (!(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) | 891 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || |
892 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) || | ||
893 | (key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE))) | ||
888 | increment_tailroom_need_count(key->sdata); | 894 | increment_tailroom_need_count(key->sdata); |
889 | } | 895 | } |
890 | 896 | ||
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 1d5341f3761d..5d3daae98bf0 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c | |||
@@ -183,6 +183,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
183 | struct nf_conn *ct; | 183 | struct nf_conn *ct; |
184 | struct net *net; | 184 | struct net *net; |
185 | 185 | ||
186 | *diff = 0; | ||
187 | |||
186 | #ifdef CONFIG_IP_VS_IPV6 | 188 | #ifdef CONFIG_IP_VS_IPV6 |
187 | /* This application helper doesn't work with IPv6 yet, | 189 | /* This application helper doesn't work with IPv6 yet, |
188 | * so turn this into a no-op for IPv6 packets | 190 | * so turn this into a no-op for IPv6 packets |
@@ -191,8 +193,6 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
191 | return 1; | 193 | return 1; |
192 | #endif | 194 | #endif |
193 | 195 | ||
194 | *diff = 0; | ||
195 | |||
196 | /* Only useful for established sessions */ | 196 | /* Only useful for established sessions */ |
197 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) | 197 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) |
198 | return 1; | 198 | return 1; |
@@ -322,6 +322,9 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
322 | struct ip_vs_conn *n_cp; | 322 | struct ip_vs_conn *n_cp; |
323 | struct net *net; | 323 | struct net *net; |
324 | 324 | ||
325 | /* no diff required for incoming packets */ | ||
326 | *diff = 0; | ||
327 | |||
325 | #ifdef CONFIG_IP_VS_IPV6 | 328 | #ifdef CONFIG_IP_VS_IPV6 |
326 | /* This application helper doesn't work with IPv6 yet, | 329 | /* This application helper doesn't work with IPv6 yet, |
327 | * so turn this into a no-op for IPv6 packets | 330 | * so turn this into a no-op for IPv6 packets |
@@ -330,9 +333,6 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
330 | return 1; | 333 | return 1; |
331 | #endif | 334 | #endif |
332 | 335 | ||
333 | /* no diff required for incoming packets */ | ||
334 | *diff = 0; | ||
335 | |||
336 | /* Only useful for established sessions */ | 336 | /* Only useful for established sessions */ |
337 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) | 337 | if (cp->state != IP_VS_TCP_S_ESTABLISHED) |
338 | return 1; | 338 | return 1; |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index a11674806707..46d1b26a468e 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -611,16 +611,15 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
611 | */ | 611 | */ |
612 | NF_CT_ASSERT(!nf_ct_is_confirmed(ct)); | 612 | NF_CT_ASSERT(!nf_ct_is_confirmed(ct)); |
613 | pr_debug("Confirming conntrack %p\n", ct); | 613 | pr_debug("Confirming conntrack %p\n", ct); |
614 | /* We have to check the DYING flag inside the lock to prevent | 614 | /* We have to check the DYING flag after unlink to prevent |
615 | a race against nf_ct_get_next_corpse() possibly called from | 615 | * a race against nf_ct_get_next_corpse() possibly called from |
616 | user context, else we insert an already 'dead' hash, blocking | 616 | * user context, else we insert an already 'dead' hash, blocking |
617 | further use of that particular connection -JM */ | 617 | * further use of that particular connection -JM. |
618 | */ | ||
619 | nf_ct_del_from_dying_or_unconfirmed_list(ct); | ||
618 | 620 | ||
619 | if (unlikely(nf_ct_is_dying(ct))) { | 621 | if (unlikely(nf_ct_is_dying(ct))) |
620 | nf_conntrack_double_unlock(hash, reply_hash); | 622 | goto out; |
621 | local_bh_enable(); | ||
622 | return NF_ACCEPT; | ||
623 | } | ||
624 | 623 | ||
625 | /* See if there's one in the list already, including reverse: | 624 | /* See if there's one in the list already, including reverse: |
626 | NAT could have grabbed it without realizing, since we're | 625 | NAT could have grabbed it without realizing, since we're |
@@ -636,8 +635,6 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
636 | zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h))) | 635 | zone == nf_ct_zone(nf_ct_tuplehash_to_ctrack(h))) |
637 | goto out; | 636 | goto out; |
638 | 637 | ||
639 | nf_ct_del_from_dying_or_unconfirmed_list(ct); | ||
640 | |||
641 | /* Timer relative to confirmation time, not original | 638 | /* Timer relative to confirmation time, not original |
642 | setting time, otherwise we'd get timer wrap in | 639 | setting time, otherwise we'd get timer wrap in |
643 | weird delay cases. */ | 640 | weird delay cases. */ |
@@ -673,6 +670,7 @@ __nf_conntrack_confirm(struct sk_buff *skb) | |||
673 | return NF_ACCEPT; | 670 | return NF_ACCEPT; |
674 | 671 | ||
675 | out: | 672 | out: |
673 | nf_ct_add_to_dying_list(ct); | ||
676 | nf_conntrack_double_unlock(hash, reply_hash); | 674 | nf_conntrack_double_unlock(hash, reply_hash); |
677 | NF_CT_STAT_INC(net, insert_failed); | 675 | NF_CT_STAT_INC(net, insert_failed); |
678 | local_bh_enable(); | 676 | local_bh_enable(); |
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 129a8daa4abf..3b3ddb4fb9ee 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
@@ -713,16 +713,12 @@ static int nft_flush_table(struct nft_ctx *ctx) | |||
713 | struct nft_chain *chain, *nc; | 713 | struct nft_chain *chain, *nc; |
714 | struct nft_set *set, *ns; | 714 | struct nft_set *set, *ns; |
715 | 715 | ||
716 | list_for_each_entry_safe(chain, nc, &ctx->table->chains, list) { | 716 | list_for_each_entry(chain, &ctx->table->chains, list) { |
717 | ctx->chain = chain; | 717 | ctx->chain = chain; |
718 | 718 | ||
719 | err = nft_delrule_by_chain(ctx); | 719 | err = nft_delrule_by_chain(ctx); |
720 | if (err < 0) | 720 | if (err < 0) |
721 | goto out; | 721 | goto out; |
722 | |||
723 | err = nft_delchain(ctx); | ||
724 | if (err < 0) | ||
725 | goto out; | ||
726 | } | 722 | } |
727 | 723 | ||
728 | list_for_each_entry_safe(set, ns, &ctx->table->sets, list) { | 724 | list_for_each_entry_safe(set, ns, &ctx->table->sets, list) { |
@@ -735,6 +731,14 @@ static int nft_flush_table(struct nft_ctx *ctx) | |||
735 | goto out; | 731 | goto out; |
736 | } | 732 | } |
737 | 733 | ||
734 | list_for_each_entry_safe(chain, nc, &ctx->table->chains, list) { | ||
735 | ctx->chain = chain; | ||
736 | |||
737 | err = nft_delchain(ctx); | ||
738 | if (err < 0) | ||
739 | goto out; | ||
740 | } | ||
741 | |||
738 | err = nft_deltable(ctx); | 742 | err = nft_deltable(ctx); |
739 | out: | 743 | out: |
740 | return err; | 744 | return err; |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index cde4a6702fa3..c421d94c4652 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -321,7 +321,8 @@ replay: | |||
321 | nlh = nlmsg_hdr(skb); | 321 | nlh = nlmsg_hdr(skb); |
322 | err = 0; | 322 | err = 0; |
323 | 323 | ||
324 | if (nlh->nlmsg_len < NLMSG_HDRLEN) { | 324 | if (nlmsg_len(nlh) < sizeof(struct nfgenmsg) || |
325 | skb->len < nlh->nlmsg_len) { | ||
325 | err = -EINVAL; | 326 | err = -EINVAL; |
326 | goto ack; | 327 | goto ack; |
327 | } | 328 | } |
@@ -469,7 +470,7 @@ static int nfnetlink_bind(struct net *net, int group) | |||
469 | int type; | 470 | int type; |
470 | 471 | ||
471 | if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX) | 472 | if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX) |
472 | return -EINVAL; | 473 | return 0; |
473 | 474 | ||
474 | type = nfnl_group2type[group]; | 475 | type = nfnl_group2type[group]; |
475 | 476 | ||
diff --git a/net/netfilter/nft_nat.c b/net/netfilter/nft_nat.c index afe2b0b45ec4..aff54fb1c8a0 100644 --- a/net/netfilter/nft_nat.c +++ b/net/netfilter/nft_nat.c | |||
@@ -65,10 +65,10 @@ static void nft_nat_eval(const struct nft_expr *expr, | |||
65 | } | 65 | } |
66 | 66 | ||
67 | if (priv->sreg_proto_min) { | 67 | if (priv->sreg_proto_min) { |
68 | range.min_proto.all = (__force __be16) | 68 | range.min_proto.all = |
69 | data[priv->sreg_proto_min].data[0]; | 69 | *(__be16 *)&data[priv->sreg_proto_min].data[0]; |
70 | range.max_proto.all = (__force __be16) | 70 | range.max_proto.all = |
71 | data[priv->sreg_proto_max].data[0]; | 71 | *(__be16 *)&data[priv->sreg_proto_max].data[0]; |
72 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; | 72 | range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; |
73 | } | 73 | } |
74 | 74 | ||
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 4e9a5f035cbc..b07349e82d78 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -524,7 +524,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info) | |||
524 | struct vport *input_vport; | 524 | struct vport *input_vport; |
525 | int len; | 525 | int len; |
526 | int err; | 526 | int err; |
527 | bool log = !a[OVS_FLOW_ATTR_PROBE]; | 527 | bool log = !a[OVS_PACKET_ATTR_PROBE]; |
528 | 528 | ||
529 | err = -EINVAL; | 529 | err = -EINVAL; |
530 | if (!a[OVS_PACKET_ATTR_PACKET] || !a[OVS_PACKET_ATTR_KEY] || | 530 | if (!a[OVS_PACKET_ATTR_PACKET] || !a[OVS_PACKET_ATTR_KEY] || |
@@ -610,6 +610,7 @@ static const struct nla_policy packet_policy[OVS_PACKET_ATTR_MAX + 1] = { | |||
610 | [OVS_PACKET_ATTR_PACKET] = { .len = ETH_HLEN }, | 610 | [OVS_PACKET_ATTR_PACKET] = { .len = ETH_HLEN }, |
611 | [OVS_PACKET_ATTR_KEY] = { .type = NLA_NESTED }, | 611 | [OVS_PACKET_ATTR_KEY] = { .type = NLA_NESTED }, |
612 | [OVS_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED }, | 612 | [OVS_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED }, |
613 | [OVS_PACKET_ATTR_PROBE] = { .type = NLA_FLAG }, | ||
613 | }; | 614 | }; |
614 | 615 | ||
615 | static const struct genl_ops dp_packet_genl_ops[] = { | 616 | static const struct genl_ops dp_packet_genl_ops[] = { |
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 70bef2ab7f2b..da2fae0873a5 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c | |||
@@ -70,6 +70,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
70 | { | 70 | { |
71 | struct flow_stats *stats; | 71 | struct flow_stats *stats; |
72 | int node = numa_node_id(); | 72 | int node = numa_node_id(); |
73 | int len = skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); | ||
73 | 74 | ||
74 | stats = rcu_dereference(flow->stats[node]); | 75 | stats = rcu_dereference(flow->stats[node]); |
75 | 76 | ||
@@ -105,7 +106,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
105 | if (likely(new_stats)) { | 106 | if (likely(new_stats)) { |
106 | new_stats->used = jiffies; | 107 | new_stats->used = jiffies; |
107 | new_stats->packet_count = 1; | 108 | new_stats->packet_count = 1; |
108 | new_stats->byte_count = skb->len; | 109 | new_stats->byte_count = len; |
109 | new_stats->tcp_flags = tcp_flags; | 110 | new_stats->tcp_flags = tcp_flags; |
110 | spin_lock_init(&new_stats->lock); | 111 | spin_lock_init(&new_stats->lock); |
111 | 112 | ||
@@ -120,7 +121,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags, | |||
120 | 121 | ||
121 | stats->used = jiffies; | 122 | stats->used = jiffies; |
122 | stats->packet_count++; | 123 | stats->packet_count++; |
123 | stats->byte_count += skb->len; | 124 | stats->byte_count += len; |
124 | stats->tcp_flags |= tcp_flags; | 125 | stats->tcp_flags |= tcp_flags; |
125 | unlock: | 126 | unlock: |
126 | spin_unlock(&stats->lock); | 127 | spin_unlock(&stats->lock); |
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 53f3ebbfceab..2034c6d9cb5a 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c | |||
@@ -480,7 +480,7 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb, | |||
480 | stats = this_cpu_ptr(vport->percpu_stats); | 480 | stats = this_cpu_ptr(vport->percpu_stats); |
481 | u64_stats_update_begin(&stats->syncp); | 481 | u64_stats_update_begin(&stats->syncp); |
482 | stats->rx_packets++; | 482 | stats->rx_packets++; |
483 | stats->rx_bytes += skb->len; | 483 | stats->rx_bytes += skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); |
484 | u64_stats_update_end(&stats->syncp); | 484 | u64_stats_update_end(&stats->syncp); |
485 | 485 | ||
486 | OVS_CB(skb)->input_vport = vport; | 486 | OVS_CB(skb)->input_vport = vport; |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 6880f34a529a..9cfe2e1dd8b5 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -2517,7 +2517,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) | |||
2517 | err = -EINVAL; | 2517 | err = -EINVAL; |
2518 | if (sock->type == SOCK_DGRAM) { | 2518 | if (sock->type == SOCK_DGRAM) { |
2519 | offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); | 2519 | offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); |
2520 | if (unlikely(offset) < 0) | 2520 | if (unlikely(offset < 0)) |
2521 | goto out_free; | 2521 | goto out_free; |
2522 | } else { | 2522 | } else { |
2523 | if (ll_header_truncated(dev, len)) | 2523 | if (ll_header_truncated(dev, len)) |
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 96ceefeb9daf..a9e174fc0f91 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -220,10 +220,11 @@ static void bclink_retransmit_pkt(u32 after, u32 to) | |||
220 | struct sk_buff *skb; | 220 | struct sk_buff *skb; |
221 | 221 | ||
222 | skb_queue_walk(&bcl->outqueue, skb) { | 222 | skb_queue_walk(&bcl->outqueue, skb) { |
223 | if (more(buf_seqno(skb), after)) | 223 | if (more(buf_seqno(skb), after)) { |
224 | tipc_link_retransmit(bcl, skb, mod(to - after)); | ||
224 | break; | 225 | break; |
226 | } | ||
225 | } | 227 | } |
226 | tipc_link_retransmit(bcl, skb, mod(to - after)); | ||
227 | } | 228 | } |
228 | 229 | ||
229 | /** | 230 | /** |