diff options
Diffstat (limited to 'net')
40 files changed, 220 insertions, 106 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 9ee48cb30179..3d33ecf13327 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c | |||
@@ -368,7 +368,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt, | |||
368 | const char *sptr = va_arg(ap, const char *); | 368 | const char *sptr = va_arg(ap, const char *); |
369 | uint16_t len = 0; | 369 | uint16_t len = 0; |
370 | if (sptr) | 370 | if (sptr) |
371 | len = min_t(uint16_t, strlen(sptr), | 371 | len = min_t(size_t, strlen(sptr), |
372 | USHRT_MAX); | 372 | USHRT_MAX); |
373 | 373 | ||
374 | errcode = p9pdu_writef(pdu, proto_version, | 374 | errcode = p9pdu_writef(pdu, proto_version, |
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 5af18d11b518..2a167658bb95 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
@@ -192,10 +192,10 @@ static int pack_sg_list(struct scatterlist *sg, int start, | |||
192 | s = rest_of_page(data); | 192 | s = rest_of_page(data); |
193 | if (s > count) | 193 | if (s > count) |
194 | s = count; | 194 | s = count; |
195 | BUG_ON(index > limit); | ||
195 | sg_set_buf(&sg[index++], data, s); | 196 | sg_set_buf(&sg[index++], data, s); |
196 | count -= s; | 197 | count -= s; |
197 | data += s; | 198 | data += s; |
198 | BUG_ON(index > limit); | ||
199 | } | 199 | } |
200 | 200 | ||
201 | return index-start; | 201 | return index-start; |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 840e2c64a301..015471d801b4 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -617,6 +617,8 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if) | |||
617 | * changes */ | 617 | * changes */ |
618 | if (skb_linearize(skb) < 0) | 618 | if (skb_linearize(skb) < 0) |
619 | goto out; | 619 | goto out; |
620 | /* skb_linearize() possibly changed skb->data */ | ||
621 | tt_query = (struct tt_query_packet *)skb->data; | ||
620 | 622 | ||
621 | tt_len = tt_query->tt_data * sizeof(struct tt_change); | 623 | tt_len = tt_query->tt_data * sizeof(struct tt_change); |
622 | 624 | ||
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index a66c2dcd1088..2ab83d7fb1f8 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -141,13 +141,14 @@ static void tt_orig_list_entry_free_rcu(struct rcu_head *rcu) | |||
141 | struct tt_orig_list_entry *orig_entry; | 141 | struct tt_orig_list_entry *orig_entry; |
142 | 142 | ||
143 | orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); | 143 | orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); |
144 | atomic_dec(&orig_entry->orig_node->tt_size); | ||
145 | orig_node_free_ref(orig_entry->orig_node); | 144 | orig_node_free_ref(orig_entry->orig_node); |
146 | kfree(orig_entry); | 145 | kfree(orig_entry); |
147 | } | 146 | } |
148 | 147 | ||
149 | static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry) | 148 | static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry) |
150 | { | 149 | { |
150 | /* to avoid race conditions, immediately decrease the tt counter */ | ||
151 | atomic_dec(&orig_entry->orig_node->tt_size); | ||
151 | call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu); | 152 | call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu); |
152 | } | 153 | } |
153 | 154 | ||
@@ -910,7 +911,6 @@ void tt_global_del_orig(struct bat_priv *bat_priv, | |||
910 | } | 911 | } |
911 | spin_unlock_bh(list_lock); | 912 | spin_unlock_bh(list_lock); |
912 | } | 913 | } |
913 | atomic_set(&orig_node->tt_size, 0); | ||
914 | orig_node->tt_initialised = false; | 914 | orig_node->tt_initialised = false; |
915 | } | 915 | } |
916 | 916 | ||
@@ -2031,10 +2031,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst) | |||
2031 | { | 2031 | { |
2032 | struct tt_local_entry *tt_local_entry = NULL; | 2032 | struct tt_local_entry *tt_local_entry = NULL; |
2033 | struct tt_global_entry *tt_global_entry = NULL; | 2033 | struct tt_global_entry *tt_global_entry = NULL; |
2034 | bool ret = true; | 2034 | bool ret = false; |
2035 | 2035 | ||
2036 | if (!atomic_read(&bat_priv->ap_isolation)) | 2036 | if (!atomic_read(&bat_priv->ap_isolation)) |
2037 | return false; | 2037 | goto out; |
2038 | 2038 | ||
2039 | tt_local_entry = tt_local_hash_find(bat_priv, dst); | 2039 | tt_local_entry = tt_local_hash_find(bat_priv, dst); |
2040 | if (!tt_local_entry) | 2040 | if (!tt_local_entry) |
@@ -2044,10 +2044,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst) | |||
2044 | if (!tt_global_entry) | 2044 | if (!tt_global_entry) |
2045 | goto out; | 2045 | goto out; |
2046 | 2046 | ||
2047 | if (_is_ap_isolated(tt_local_entry, tt_global_entry)) | 2047 | if (!_is_ap_isolated(tt_local_entry, tt_global_entry)) |
2048 | goto out; | 2048 | goto out; |
2049 | 2049 | ||
2050 | ret = false; | 2050 | ret = true; |
2051 | 2051 | ||
2052 | out: | 2052 | out: |
2053 | if (tt_global_entry) | 2053 | if (tt_global_entry) |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 4eefb7f65cf6..94ad124a4ea3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -3043,6 +3043,50 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct | |||
3043 | hci_dev_unlock(hdev); | 3043 | hci_dev_unlock(hdev); |
3044 | } | 3044 | } |
3045 | 3045 | ||
3046 | static void hci_key_refresh_complete_evt(struct hci_dev *hdev, | ||
3047 | struct sk_buff *skb) | ||
3048 | { | ||
3049 | struct hci_ev_key_refresh_complete *ev = (void *) skb->data; | ||
3050 | struct hci_conn *conn; | ||
3051 | |||
3052 | BT_DBG("%s status %u handle %u", hdev->name, ev->status, | ||
3053 | __le16_to_cpu(ev->handle)); | ||
3054 | |||
3055 | hci_dev_lock(hdev); | ||
3056 | |||
3057 | conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); | ||
3058 | if (!conn) | ||
3059 | goto unlock; | ||
3060 | |||
3061 | if (!ev->status) | ||
3062 | conn->sec_level = conn->pending_sec_level; | ||
3063 | |||
3064 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); | ||
3065 | |||
3066 | if (ev->status && conn->state == BT_CONNECTED) { | ||
3067 | hci_acl_disconn(conn, HCI_ERROR_AUTH_FAILURE); | ||
3068 | hci_conn_put(conn); | ||
3069 | goto unlock; | ||
3070 | } | ||
3071 | |||
3072 | if (conn->state == BT_CONFIG) { | ||
3073 | if (!ev->status) | ||
3074 | conn->state = BT_CONNECTED; | ||
3075 | |||
3076 | hci_proto_connect_cfm(conn, ev->status); | ||
3077 | hci_conn_put(conn); | ||
3078 | } else { | ||
3079 | hci_auth_cfm(conn, ev->status); | ||
3080 | |||
3081 | hci_conn_hold(conn); | ||
3082 | conn->disc_timeout = HCI_DISCONN_TIMEOUT; | ||
3083 | hci_conn_put(conn); | ||
3084 | } | ||
3085 | |||
3086 | unlock: | ||
3087 | hci_dev_unlock(hdev); | ||
3088 | } | ||
3089 | |||
3046 | static inline u8 hci_get_auth_req(struct hci_conn *conn) | 3090 | static inline u8 hci_get_auth_req(struct hci_conn *conn) |
3047 | { | 3091 | { |
3048 | /* If remote requests dedicated bonding follow that lead */ | 3092 | /* If remote requests dedicated bonding follow that lead */ |
@@ -3559,6 +3603,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
3559 | hci_extended_inquiry_result_evt(hdev, skb); | 3603 | hci_extended_inquiry_result_evt(hdev, skb); |
3560 | break; | 3604 | break; |
3561 | 3605 | ||
3606 | case HCI_EV_KEY_REFRESH_COMPLETE: | ||
3607 | hci_key_refresh_complete_evt(hdev, skb); | ||
3608 | break; | ||
3609 | |||
3562 | case HCI_EV_IO_CAPA_REQUEST: | 3610 | case HCI_EV_IO_CAPA_REQUEST: |
3563 | hci_io_capa_request_evt(hdev, skb); | 3611 | hci_io_capa_request_evt(hdev, skb); |
3564 | break; | 3612 | break; |
diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig index 4deaca78e91e..9332bc7aa851 100644 --- a/net/bluetooth/hidp/Kconfig +++ b/net/bluetooth/hidp/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config BT_HIDP | 1 | config BT_HIDP |
2 | tristate "HIDP protocol support" | 2 | tristate "HIDP protocol support" |
3 | depends on BT && INPUT && HID_SUPPORT | 3 | depends on BT && INPUT |
4 | select HID | 4 | select HID |
5 | help | 5 | help |
6 | HIDP (Human Interface Device Protocol) is a transport layer | 6 | HIDP (Human Interface Device Protocol) is a transport layer |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 24f144b72a96..4554e80d16a3 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1295,7 +1295,12 @@ static void security_timeout(struct work_struct *work) | |||
1295 | struct l2cap_conn *conn = container_of(work, struct l2cap_conn, | 1295 | struct l2cap_conn *conn = container_of(work, struct l2cap_conn, |
1296 | security_timer.work); | 1296 | security_timer.work); |
1297 | 1297 | ||
1298 | l2cap_conn_del(conn->hcon, ETIMEDOUT); | 1298 | BT_DBG("conn %p", conn); |
1299 | |||
1300 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { | ||
1301 | smp_chan_destroy(conn); | ||
1302 | l2cap_conn_del(conn->hcon, ETIMEDOUT); | ||
1303 | } | ||
1299 | } | 1304 | } |
1300 | 1305 | ||
1301 | static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) | 1306 | static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) |
@@ -2910,12 +2915,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len) | |||
2910 | while (len >= L2CAP_CONF_OPT_SIZE) { | 2915 | while (len >= L2CAP_CONF_OPT_SIZE) { |
2911 | len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val); | 2916 | len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val); |
2912 | 2917 | ||
2913 | switch (type) { | 2918 | if (type != L2CAP_CONF_RFC) |
2914 | case L2CAP_CONF_RFC: | 2919 | continue; |
2915 | if (olen == sizeof(rfc)) | 2920 | |
2916 | memcpy(&rfc, (void *)val, olen); | 2921 | if (olen != sizeof(rfc)) |
2917 | goto done; | 2922 | break; |
2918 | } | 2923 | |
2924 | memcpy(&rfc, (void *)val, olen); | ||
2925 | goto done; | ||
2919 | } | 2926 | } |
2920 | 2927 | ||
2921 | /* Use sane default values in case a misbehaving remote device | 2928 | /* Use sane default values in case a misbehaving remote device |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 25d220776079..3e5e3362ea00 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1598,7 +1598,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1598 | else | 1598 | else |
1599 | conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); | 1599 | conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); |
1600 | 1600 | ||
1601 | if (!conn) { | 1601 | if (!conn || conn->state == BT_OPEN || conn->state == BT_CLOSED) { |
1602 | err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT, | 1602 | err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT, |
1603 | MGMT_STATUS_NOT_CONNECTED); | 1603 | MGMT_STATUS_NOT_CONNECTED); |
1604 | goto failed; | 1604 | goto failed; |
@@ -1873,6 +1873,22 @@ static void pairing_complete_cb(struct hci_conn *conn, u8 status) | |||
1873 | pairing_complete(cmd, mgmt_status(status)); | 1873 | pairing_complete(cmd, mgmt_status(status)); |
1874 | } | 1874 | } |
1875 | 1875 | ||
1876 | static void le_connect_complete_cb(struct hci_conn *conn, u8 status) | ||
1877 | { | ||
1878 | struct pending_cmd *cmd; | ||
1879 | |||
1880 | BT_DBG("status %u", status); | ||
1881 | |||
1882 | if (!status) | ||
1883 | return; | ||
1884 | |||
1885 | cmd = find_pairing(conn); | ||
1886 | if (!cmd) | ||
1887 | BT_DBG("Unable to find a pending command"); | ||
1888 | else | ||
1889 | pairing_complete(cmd, mgmt_status(status)); | ||
1890 | } | ||
1891 | |||
1876 | static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, | 1892 | static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, |
1877 | u16 len) | 1893 | u16 len) |
1878 | { | 1894 | { |
@@ -1934,6 +1950,8 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1934 | /* For LE, just connecting isn't a proof that the pairing finished */ | 1950 | /* For LE, just connecting isn't a proof that the pairing finished */ |
1935 | if (cp->addr.type == BDADDR_BREDR) | 1951 | if (cp->addr.type == BDADDR_BREDR) |
1936 | conn->connect_cfm_cb = pairing_complete_cb; | 1952 | conn->connect_cfm_cb = pairing_complete_cb; |
1953 | else | ||
1954 | conn->connect_cfm_cb = le_connect_complete_cb; | ||
1937 | 1955 | ||
1938 | conn->security_cfm_cb = pairing_complete_cb; | 1956 | conn->security_cfm_cb = pairing_complete_cb; |
1939 | conn->disconn_cfm_cb = pairing_complete_cb; | 1957 | conn->disconn_cfm_cb = pairing_complete_cb; |
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 6fc7c4708f3e..37df4e9b3896 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -648,7 +648,7 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb) | |||
648 | 648 | ||
649 | auth |= (req->auth_req | rsp->auth_req) & SMP_AUTH_MITM; | 649 | auth |= (req->auth_req | rsp->auth_req) & SMP_AUTH_MITM; |
650 | 650 | ||
651 | ret = tk_request(conn, 0, auth, rsp->io_capability, req->io_capability); | 651 | ret = tk_request(conn, 0, auth, req->io_capability, rsp->io_capability); |
652 | if (ret) | 652 | if (ret) |
653 | return SMP_UNSPECIFIED; | 653 | return SMP_UNSPECIFIED; |
654 | 654 | ||
@@ -703,7 +703,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) | |||
703 | return 0; | 703 | return 0; |
704 | } | 704 | } |
705 | 705 | ||
706 | static u8 smp_ltk_encrypt(struct l2cap_conn *conn) | 706 | static u8 smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level) |
707 | { | 707 | { |
708 | struct smp_ltk *key; | 708 | struct smp_ltk *key; |
709 | struct hci_conn *hcon = conn->hcon; | 709 | struct hci_conn *hcon = conn->hcon; |
@@ -712,6 +712,9 @@ static u8 smp_ltk_encrypt(struct l2cap_conn *conn) | |||
712 | if (!key) | 712 | if (!key) |
713 | return 0; | 713 | return 0; |
714 | 714 | ||
715 | if (sec_level > BT_SECURITY_MEDIUM && !key->authenticated) | ||
716 | return 0; | ||
717 | |||
715 | if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags)) | 718 | if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags)) |
716 | return 1; | 719 | return 1; |
717 | 720 | ||
@@ -732,7 +735,7 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb) | |||
732 | 735 | ||
733 | hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req); | 736 | hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req); |
734 | 737 | ||
735 | if (smp_ltk_encrypt(conn)) | 738 | if (smp_ltk_encrypt(conn, hcon->pending_sec_level)) |
736 | return 0; | 739 | return 0; |
737 | 740 | ||
738 | if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) | 741 | if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) |
@@ -771,7 +774,7 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level) | |||
771 | return 1; | 774 | return 1; |
772 | 775 | ||
773 | if (hcon->link_mode & HCI_LM_MASTER) | 776 | if (hcon->link_mode & HCI_LM_MASTER) |
774 | if (smp_ltk_encrypt(conn)) | 777 | if (smp_ltk_encrypt(conn, sec_level)) |
775 | goto done; | 778 | goto done; |
776 | 779 | ||
777 | if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) | 780 | if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 0a942fbccc9a..e1144e1617be 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -240,6 +240,7 @@ int br_add_bridge(struct net *net, const char *name) | |||
240 | return -ENOMEM; | 240 | return -ENOMEM; |
241 | 241 | ||
242 | dev_net_set(dev, net); | 242 | dev_net_set(dev, net); |
243 | dev->rtnl_link_ops = &br_link_ops; | ||
243 | 244 | ||
244 | res = register_netdev(dev); | 245 | res = register_netdev(dev); |
245 | if (res) | 246 | if (res) |
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 2080485515f1..fe41260fbf38 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
@@ -208,7 +208,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[]) | |||
208 | return 0; | 208 | return 0; |
209 | } | 209 | } |
210 | 210 | ||
211 | static struct rtnl_link_ops br_link_ops __read_mostly = { | 211 | struct rtnl_link_ops br_link_ops __read_mostly = { |
212 | .kind = "bridge", | 212 | .kind = "bridge", |
213 | .priv_size = sizeof(struct net_bridge), | 213 | .priv_size = sizeof(struct net_bridge), |
214 | .setup = br_dev_setup, | 214 | .setup = br_dev_setup, |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 1a8ad4fb9a6b..a768b2408edf 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -549,6 +549,7 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr) | |||
549 | #endif | 549 | #endif |
550 | 550 | ||
551 | /* br_netlink.c */ | 551 | /* br_netlink.c */ |
552 | extern struct rtnl_link_ops br_link_ops; | ||
552 | extern int br_netlink_init(void); | 553 | extern int br_netlink_init(void); |
553 | extern void br_netlink_fini(void); | 554 | extern void br_netlink_fini(void); |
554 | extern void br_ifinfo_notify(int event, struct net_bridge_port *port); | 555 | extern void br_ifinfo_notify(int event, struct net_bridge_port *port); |
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index aa6f716524fd..554b31289607 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c | |||
@@ -4,8 +4,7 @@ | |||
4 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | 4 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com |
5 | * License terms: GNU General Public License (GPL) version 2 | 5 | * License terms: GNU General Public License (GPL) version 2 |
6 | * | 6 | * |
7 | * Borrowed heavily from file: pn_dev.c. Thanks to | 7 | * Borrowed heavily from file: pn_dev.c. Thanks to Remi Denis-Courmont |
8 | * Remi Denis-Courmont <remi.denis-courmont@nokia.com> | ||
9 | * and Sakari Ailus <sakari.ailus@nokia.com> | 8 | * and Sakari Ailus <sakari.ailus@nokia.com> |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index fb8944355264..78f1cdad5b33 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -220,6 +220,7 @@ static void caif_ctrl_cb(struct cflayer *layr, | |||
220 | cfsk_hold, cfsk_put); | 220 | cfsk_hold, cfsk_put); |
221 | cf_sk->sk.sk_state = CAIF_CONNECTED; | 221 | cf_sk->sk.sk_state = CAIF_CONNECTED; |
222 | set_tx_flow_on(cf_sk); | 222 | set_tx_flow_on(cf_sk); |
223 | cf_sk->sk.sk_shutdown = 0; | ||
223 | cf_sk->sk.sk_state_change(&cf_sk->sk); | 224 | cf_sk->sk.sk_state_change(&cf_sk->sk); |
224 | break; | 225 | break; |
225 | 226 | ||
diff --git a/net/can/raw.c b/net/can/raw.c index cde1b4a20f75..46cca3a91d19 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -681,9 +681,6 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
681 | if (err < 0) | 681 | if (err < 0) |
682 | goto free_skb; | 682 | goto free_skb; |
683 | 683 | ||
684 | /* to be able to check the received tx sock reference in raw_rcv() */ | ||
685 | skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF; | ||
686 | |||
687 | skb->dev = dev; | 684 | skb->dev = dev; |
688 | skb->sk = sk; | 685 | skb->sk = sk; |
689 | 686 | ||
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index a776f751edbf..ba4323bce0e9 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c | |||
@@ -504,13 +504,6 @@ void ceph_destroy_client(struct ceph_client *client) | |||
504 | /* unmount */ | 504 | /* unmount */ |
505 | ceph_osdc_stop(&client->osdc); | 505 | ceph_osdc_stop(&client->osdc); |
506 | 506 | ||
507 | /* | ||
508 | * make sure osd connections close out before destroying the | ||
509 | * auth module, which is needed to free those connections' | ||
510 | * ceph_authorizers. | ||
511 | */ | ||
512 | ceph_msgr_flush(); | ||
513 | |||
514 | ceph_monc_stop(&client->monc); | 507 | ceph_monc_stop(&client->monc); |
515 | 508 | ||
516 | ceph_debugfs_client_cleanup(client); | 509 | ceph_debugfs_client_cleanup(client); |
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 524f4e4f598b..b332c3d76059 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -563,6 +563,10 @@ static void prepare_write_message(struct ceph_connection *con) | |||
563 | m->hdr.seq = cpu_to_le64(++con->out_seq); | 563 | m->hdr.seq = cpu_to_le64(++con->out_seq); |
564 | m->needs_out_seq = false; | 564 | m->needs_out_seq = false; |
565 | } | 565 | } |
566 | #ifdef CONFIG_BLOCK | ||
567 | else | ||
568 | m->bio_iter = NULL; | ||
569 | #endif | ||
566 | 570 | ||
567 | dout("prepare_write_message %p seq %lld type %d len %d+%d+%d %d pgs\n", | 571 | dout("prepare_write_message %p seq %lld type %d len %d+%d+%d %d pgs\n", |
568 | m, con->out_seq, le16_to_cpu(m->hdr.type), | 572 | m, con->out_seq, le16_to_cpu(m->hdr.type), |
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index 10d6008d31f2..d0649a9655be 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c | |||
@@ -847,6 +847,14 @@ void ceph_monc_stop(struct ceph_mon_client *monc) | |||
847 | 847 | ||
848 | mutex_unlock(&monc->mutex); | 848 | mutex_unlock(&monc->mutex); |
849 | 849 | ||
850 | /* | ||
851 | * flush msgr queue before we destroy ourselves to ensure that: | ||
852 | * - any work that references our embedded con is finished. | ||
853 | * - any osd_client or other work that may reference an authorizer | ||
854 | * finishes before we shut down the auth subsystem. | ||
855 | */ | ||
856 | ceph_msgr_flush(); | ||
857 | |||
850 | ceph_auth_destroy(monc->auth); | 858 | ceph_auth_destroy(monc->auth); |
851 | 859 | ||
852 | ceph_msg_put(monc->m_auth); | 860 | ceph_msg_put(monc->m_auth); |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 1ffebed5ce0f..ca59e66c9787 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -139,15 +139,15 @@ void ceph_osdc_release_request(struct kref *kref) | |||
139 | 139 | ||
140 | if (req->r_request) | 140 | if (req->r_request) |
141 | ceph_msg_put(req->r_request); | 141 | ceph_msg_put(req->r_request); |
142 | if (req->r_reply) | ||
143 | ceph_msg_put(req->r_reply); | ||
144 | if (req->r_con_filling_msg) { | 142 | if (req->r_con_filling_msg) { |
145 | dout("release_request revoking pages %p from con %p\n", | 143 | dout("release_request revoking pages %p from con %p\n", |
146 | req->r_pages, req->r_con_filling_msg); | 144 | req->r_pages, req->r_con_filling_msg); |
147 | ceph_con_revoke_message(req->r_con_filling_msg, | 145 | ceph_con_revoke_message(req->r_con_filling_msg, |
148 | req->r_reply); | 146 | req->r_reply); |
149 | ceph_con_put(req->r_con_filling_msg); | 147 | req->r_con_filling_msg->ops->put(req->r_con_filling_msg); |
150 | } | 148 | } |
149 | if (req->r_reply) | ||
150 | ceph_msg_put(req->r_reply); | ||
151 | if (req->r_own_pages) | 151 | if (req->r_own_pages) |
152 | ceph_release_page_vector(req->r_pages, | 152 | ceph_release_page_vector(req->r_pages, |
153 | req->r_num_pages); | 153 | req->r_num_pages); |
@@ -1216,7 +1216,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
1216 | if (req->r_con_filling_msg == con && req->r_reply == msg) { | 1216 | if (req->r_con_filling_msg == con && req->r_reply == msg) { |
1217 | dout(" dropping con_filling_msg ref %p\n", con); | 1217 | dout(" dropping con_filling_msg ref %p\n", con); |
1218 | req->r_con_filling_msg = NULL; | 1218 | req->r_con_filling_msg = NULL; |
1219 | ceph_con_put(con); | 1219 | con->ops->put(con); |
1220 | } | 1220 | } |
1221 | 1221 | ||
1222 | if (!req->r_got_reply) { | 1222 | if (!req->r_got_reply) { |
@@ -2028,7 +2028,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
2028 | dout("get_reply revoking msg %p from old con %p\n", | 2028 | dout("get_reply revoking msg %p from old con %p\n", |
2029 | req->r_reply, req->r_con_filling_msg); | 2029 | req->r_reply, req->r_con_filling_msg); |
2030 | ceph_con_revoke_message(req->r_con_filling_msg, req->r_reply); | 2030 | ceph_con_revoke_message(req->r_con_filling_msg, req->r_reply); |
2031 | ceph_con_put(req->r_con_filling_msg); | 2031 | req->r_con_filling_msg->ops->put(req->r_con_filling_msg); |
2032 | req->r_con_filling_msg = NULL; | 2032 | req->r_con_filling_msg = NULL; |
2033 | } | 2033 | } |
2034 | 2034 | ||
@@ -2063,7 +2063,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
2063 | #endif | 2063 | #endif |
2064 | } | 2064 | } |
2065 | *skip = 0; | 2065 | *skip = 0; |
2066 | req->r_con_filling_msg = ceph_con_get(con); | 2066 | req->r_con_filling_msg = con->ops->get(con); |
2067 | dout("get_reply tid %lld %p\n", tid, m); | 2067 | dout("get_reply tid %lld %p\n", tid, m); |
2068 | 2068 | ||
2069 | out: | 2069 | out: |
diff --git a/net/core/dev.c b/net/core/dev.c index cd0981977f5c..6df214041a5e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2089,25 +2089,6 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features) | |||
2089 | return 0; | 2089 | return 0; |
2090 | } | 2090 | } |
2091 | 2091 | ||
2092 | /* | ||
2093 | * Try to orphan skb early, right before transmission by the device. | ||
2094 | * We cannot orphan skb if tx timestamp is requested or the sk-reference | ||
2095 | * is needed on driver level for other reasons, e.g. see net/can/raw.c | ||
2096 | */ | ||
2097 | static inline void skb_orphan_try(struct sk_buff *skb) | ||
2098 | { | ||
2099 | struct sock *sk = skb->sk; | ||
2100 | |||
2101 | if (sk && !skb_shinfo(skb)->tx_flags) { | ||
2102 | /* skb_tx_hash() wont be able to get sk. | ||
2103 | * We copy sk_hash into skb->rxhash | ||
2104 | */ | ||
2105 | if (!skb->rxhash) | ||
2106 | skb->rxhash = sk->sk_hash; | ||
2107 | skb_orphan(skb); | ||
2108 | } | ||
2109 | } | ||
2110 | |||
2111 | static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) | 2092 | static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) |
2112 | { | 2093 | { |
2113 | return ((features & NETIF_F_GEN_CSUM) || | 2094 | return ((features & NETIF_F_GEN_CSUM) || |
@@ -2193,8 +2174,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
2193 | if (!list_empty(&ptype_all)) | 2174 | if (!list_empty(&ptype_all)) |
2194 | dev_queue_xmit_nit(skb, dev); | 2175 | dev_queue_xmit_nit(skb, dev); |
2195 | 2176 | ||
2196 | skb_orphan_try(skb); | ||
2197 | |||
2198 | features = netif_skb_features(skb); | 2177 | features = netif_skb_features(skb); |
2199 | 2178 | ||
2200 | if (vlan_tx_tag_present(skb) && | 2179 | if (vlan_tx_tag_present(skb) && |
@@ -2304,7 +2283,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb, | |||
2304 | if (skb->sk && skb->sk->sk_hash) | 2283 | if (skb->sk && skb->sk->sk_hash) |
2305 | hash = skb->sk->sk_hash; | 2284 | hash = skb->sk->sk_hash; |
2306 | else | 2285 | else |
2307 | hash = (__force u16) skb->protocol ^ skb->rxhash; | 2286 | hash = (__force u16) skb->protocol; |
2308 | hash = jhash_1word(hash, hashrnd); | 2287 | hash = jhash_1word(hash, hashrnd); |
2309 | 2288 | ||
2310 | return (u16) (((u64) hash * qcount) >> 32) + qoffset; | 2289 | return (u16) (((u64) hash * qcount) >> 32) + qoffset; |
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 74c21b924a79..608327661960 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -1349,8 +1349,8 @@ static int fib6_walk_continue(struct fib6_walker_t *w) | |||
1349 | if (w->leaf && fn->fn_flags & RTN_RTINFO) { | 1349 | if (w->leaf && fn->fn_flags & RTN_RTINFO) { |
1350 | int err; | 1350 | int err; |
1351 | 1351 | ||
1352 | if (w->count < w->skip) { | 1352 | if (w->skip) { |
1353 | w->count++; | 1353 | w->skip--; |
1354 | continue; | 1354 | continue; |
1355 | } | 1355 | } |
1356 | 1356 | ||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 999a982ad3fd..becb048d18d4 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2957,10 +2957,6 @@ static int __net_init ip6_route_net_init(struct net *net) | |||
2957 | net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ; | 2957 | net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ; |
2958 | net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; | 2958 | net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; |
2959 | 2959 | ||
2960 | #ifdef CONFIG_PROC_FS | ||
2961 | proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops); | ||
2962 | proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops); | ||
2963 | #endif | ||
2964 | net->ipv6.ip6_rt_gc_expire = 30*HZ; | 2960 | net->ipv6.ip6_rt_gc_expire = 30*HZ; |
2965 | 2961 | ||
2966 | ret = 0; | 2962 | ret = 0; |
@@ -2981,10 +2977,6 @@ out_ip6_dst_ops: | |||
2981 | 2977 | ||
2982 | static void __net_exit ip6_route_net_exit(struct net *net) | 2978 | static void __net_exit ip6_route_net_exit(struct net *net) |
2983 | { | 2979 | { |
2984 | #ifdef CONFIG_PROC_FS | ||
2985 | proc_net_remove(net, "ipv6_route"); | ||
2986 | proc_net_remove(net, "rt6_stats"); | ||
2987 | #endif | ||
2988 | kfree(net->ipv6.ip6_null_entry); | 2980 | kfree(net->ipv6.ip6_null_entry); |
2989 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 2981 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
2990 | kfree(net->ipv6.ip6_prohibit_entry); | 2982 | kfree(net->ipv6.ip6_prohibit_entry); |
@@ -2993,11 +2985,33 @@ static void __net_exit ip6_route_net_exit(struct net *net) | |||
2993 | dst_entries_destroy(&net->ipv6.ip6_dst_ops); | 2985 | dst_entries_destroy(&net->ipv6.ip6_dst_ops); |
2994 | } | 2986 | } |
2995 | 2987 | ||
2988 | static int __net_init ip6_route_net_init_late(struct net *net) | ||
2989 | { | ||
2990 | #ifdef CONFIG_PROC_FS | ||
2991 | proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops); | ||
2992 | proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops); | ||
2993 | #endif | ||
2994 | return 0; | ||
2995 | } | ||
2996 | |||
2997 | static void __net_exit ip6_route_net_exit_late(struct net *net) | ||
2998 | { | ||
2999 | #ifdef CONFIG_PROC_FS | ||
3000 | proc_net_remove(net, "ipv6_route"); | ||
3001 | proc_net_remove(net, "rt6_stats"); | ||
3002 | #endif | ||
3003 | } | ||
3004 | |||
2996 | static struct pernet_operations ip6_route_net_ops = { | 3005 | static struct pernet_operations ip6_route_net_ops = { |
2997 | .init = ip6_route_net_init, | 3006 | .init = ip6_route_net_init, |
2998 | .exit = ip6_route_net_exit, | 3007 | .exit = ip6_route_net_exit, |
2999 | }; | 3008 | }; |
3000 | 3009 | ||
3010 | static struct pernet_operations ip6_route_net_late_ops = { | ||
3011 | .init = ip6_route_net_init_late, | ||
3012 | .exit = ip6_route_net_exit_late, | ||
3013 | }; | ||
3014 | |||
3001 | static struct notifier_block ip6_route_dev_notifier = { | 3015 | static struct notifier_block ip6_route_dev_notifier = { |
3002 | .notifier_call = ip6_route_dev_notify, | 3016 | .notifier_call = ip6_route_dev_notify, |
3003 | .priority = 0, | 3017 | .priority = 0, |
@@ -3047,19 +3061,25 @@ int __init ip6_route_init(void) | |||
3047 | if (ret) | 3061 | if (ret) |
3048 | goto xfrm6_init; | 3062 | goto xfrm6_init; |
3049 | 3063 | ||
3064 | ret = register_pernet_subsys(&ip6_route_net_late_ops); | ||
3065 | if (ret) | ||
3066 | goto fib6_rules_init; | ||
3067 | |||
3050 | ret = -ENOBUFS; | 3068 | ret = -ENOBUFS; |
3051 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || | 3069 | if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || |
3052 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || | 3070 | __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || |
3053 | __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) | 3071 | __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) |
3054 | goto fib6_rules_init; | 3072 | goto out_register_late_subsys; |
3055 | 3073 | ||
3056 | ret = register_netdevice_notifier(&ip6_route_dev_notifier); | 3074 | ret = register_netdevice_notifier(&ip6_route_dev_notifier); |
3057 | if (ret) | 3075 | if (ret) |
3058 | goto fib6_rules_init; | 3076 | goto out_register_late_subsys; |
3059 | 3077 | ||
3060 | out: | 3078 | out: |
3061 | return ret; | 3079 | return ret; |
3062 | 3080 | ||
3081 | out_register_late_subsys: | ||
3082 | unregister_pernet_subsys(&ip6_route_net_late_ops); | ||
3063 | fib6_rules_init: | 3083 | fib6_rules_init: |
3064 | fib6_rules_cleanup(); | 3084 | fib6_rules_cleanup(); |
3065 | xfrm6_init: | 3085 | xfrm6_init: |
@@ -3078,6 +3098,7 @@ out_kmem_cache: | |||
3078 | void ip6_route_cleanup(void) | 3098 | void ip6_route_cleanup(void) |
3079 | { | 3099 | { |
3080 | unregister_netdevice_notifier(&ip6_route_dev_notifier); | 3100 | unregister_netdevice_notifier(&ip6_route_dev_notifier); |
3101 | unregister_pernet_subsys(&ip6_route_net_late_ops); | ||
3081 | fib6_rules_cleanup(); | 3102 | fib6_rules_cleanup(); |
3082 | xfrm6_fini(); | 3103 | xfrm6_fini(); |
3083 | fib6_gc_cleanup(); | 3104 | fib6_gc_cleanup(); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 3a9aec29581a..9df64a50b075 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1212,7 +1212,8 @@ have_isn: | |||
1212 | tcp_rsk(req)->snt_isn = isn; | 1212 | tcp_rsk(req)->snt_isn = isn; |
1213 | tcp_rsk(req)->snt_synack = tcp_time_stamp; | 1213 | tcp_rsk(req)->snt_synack = tcp_time_stamp; |
1214 | 1214 | ||
1215 | security_inet_conn_request(sk, skb, req); | 1215 | if (security_inet_conn_request(sk, skb, req)) |
1216 | goto drop_and_release; | ||
1216 | 1217 | ||
1217 | if (tcp_v6_send_synack(sk, req, | 1218 | if (tcp_v6_send_synack(sk, req, |
1218 | (struct request_values *)&tmp_ext, | 1219 | (struct request_values *)&tmp_ext, |
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 07d7d55a1b93..cd6f7a991d80 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
@@ -372,7 +372,6 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock, | |||
372 | skb_trim(skb, skb->dev->mtu); | 372 | skb_trim(skb, skb->dev->mtu); |
373 | } | 373 | } |
374 | skb->protocol = ETH_P_AF_IUCV; | 374 | skb->protocol = ETH_P_AF_IUCV; |
375 | skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF; | ||
376 | nskb = skb_clone(skb, GFP_ATOMIC); | 375 | nskb = skb_clone(skb, GFP_ATOMIC); |
377 | if (!nskb) | 376 | if (!nskb) |
378 | return -ENOMEM; | 377 | return -ENOMEM; |
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index 185f12f4a5fa..47b259fccd27 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c | |||
@@ -42,6 +42,11 @@ struct l2tp_eth { | |||
42 | struct sock *tunnel_sock; | 42 | struct sock *tunnel_sock; |
43 | struct l2tp_session *session; | 43 | struct l2tp_session *session; |
44 | struct list_head list; | 44 | struct list_head list; |
45 | atomic_long_t tx_bytes; | ||
46 | atomic_long_t tx_packets; | ||
47 | atomic_long_t rx_bytes; | ||
48 | atomic_long_t rx_packets; | ||
49 | atomic_long_t rx_errors; | ||
45 | }; | 50 | }; |
46 | 51 | ||
47 | /* via l2tp_session_priv() */ | 52 | /* via l2tp_session_priv() */ |
@@ -88,24 +93,40 @@ static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
88 | struct l2tp_eth *priv = netdev_priv(dev); | 93 | struct l2tp_eth *priv = netdev_priv(dev); |
89 | struct l2tp_session *session = priv->session; | 94 | struct l2tp_session *session = priv->session; |
90 | 95 | ||
96 | atomic_long_add(skb->len, &priv->tx_bytes); | ||
97 | atomic_long_inc(&priv->tx_packets); | ||
98 | |||
91 | l2tp_xmit_skb(session, skb, session->hdr_len); | 99 | l2tp_xmit_skb(session, skb, session->hdr_len); |
92 | 100 | ||
93 | dev->stats.tx_bytes += skb->len; | 101 | return NETDEV_TX_OK; |
94 | dev->stats.tx_packets++; | 102 | } |
95 | 103 | ||
96 | return 0; | 104 | static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev, |
105 | struct rtnl_link_stats64 *stats) | ||
106 | { | ||
107 | struct l2tp_eth *priv = netdev_priv(dev); | ||
108 | |||
109 | stats->tx_bytes = atomic_long_read(&priv->tx_bytes); | ||
110 | stats->tx_packets = atomic_long_read(&priv->tx_packets); | ||
111 | stats->rx_bytes = atomic_long_read(&priv->rx_bytes); | ||
112 | stats->rx_packets = atomic_long_read(&priv->rx_packets); | ||
113 | stats->rx_errors = atomic_long_read(&priv->rx_errors); | ||
114 | return stats; | ||
97 | } | 115 | } |
98 | 116 | ||
117 | |||
99 | static struct net_device_ops l2tp_eth_netdev_ops = { | 118 | static struct net_device_ops l2tp_eth_netdev_ops = { |
100 | .ndo_init = l2tp_eth_dev_init, | 119 | .ndo_init = l2tp_eth_dev_init, |
101 | .ndo_uninit = l2tp_eth_dev_uninit, | 120 | .ndo_uninit = l2tp_eth_dev_uninit, |
102 | .ndo_start_xmit = l2tp_eth_dev_xmit, | 121 | .ndo_start_xmit = l2tp_eth_dev_xmit, |
122 | .ndo_get_stats64 = l2tp_eth_get_stats64, | ||
103 | }; | 123 | }; |
104 | 124 | ||
105 | static void l2tp_eth_dev_setup(struct net_device *dev) | 125 | static void l2tp_eth_dev_setup(struct net_device *dev) |
106 | { | 126 | { |
107 | ether_setup(dev); | 127 | ether_setup(dev); |
108 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | 128 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; |
129 | dev->features |= NETIF_F_LLTX; | ||
109 | dev->netdev_ops = &l2tp_eth_netdev_ops; | 130 | dev->netdev_ops = &l2tp_eth_netdev_ops; |
110 | dev->destructor = free_netdev; | 131 | dev->destructor = free_netdev; |
111 | } | 132 | } |
@@ -114,17 +135,17 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb, | |||
114 | { | 135 | { |
115 | struct l2tp_eth_sess *spriv = l2tp_session_priv(session); | 136 | struct l2tp_eth_sess *spriv = l2tp_session_priv(session); |
116 | struct net_device *dev = spriv->dev; | 137 | struct net_device *dev = spriv->dev; |
138 | struct l2tp_eth *priv = netdev_priv(dev); | ||
117 | 139 | ||
118 | if (session->debug & L2TP_MSG_DATA) { | 140 | if (session->debug & L2TP_MSG_DATA) { |
119 | unsigned int length; | 141 | unsigned int length; |
120 | u8 *ptr = skb->data; | ||
121 | 142 | ||
122 | length = min(32u, skb->len); | 143 | length = min(32u, skb->len); |
123 | if (!pskb_may_pull(skb, length)) | 144 | if (!pskb_may_pull(skb, length)) |
124 | goto error; | 145 | goto error; |
125 | 146 | ||
126 | pr_debug("%s: eth recv\n", session->name); | 147 | pr_debug("%s: eth recv\n", session->name); |
127 | print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length); | 148 | print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length); |
128 | } | 149 | } |
129 | 150 | ||
130 | if (!pskb_may_pull(skb, sizeof(ETH_HLEN))) | 151 | if (!pskb_may_pull(skb, sizeof(ETH_HLEN))) |
@@ -139,15 +160,15 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb, | |||
139 | nf_reset(skb); | 160 | nf_reset(skb); |
140 | 161 | ||
141 | if (dev_forward_skb(dev, skb) == NET_RX_SUCCESS) { | 162 | if (dev_forward_skb(dev, skb) == NET_RX_SUCCESS) { |
142 | dev->stats.rx_packets++; | 163 | atomic_long_inc(&priv->rx_packets); |
143 | dev->stats.rx_bytes += data_len; | 164 | atomic_long_add(data_len, &priv->rx_bytes); |
144 | } else | 165 | } else { |
145 | dev->stats.rx_errors++; | 166 | atomic_long_inc(&priv->rx_errors); |
146 | 167 | } | |
147 | return; | 168 | return; |
148 | 169 | ||
149 | error: | 170 | error: |
150 | dev->stats.rx_errors++; | 171 | atomic_long_inc(&priv->rx_errors); |
151 | kfree_skb(skb); | 172 | kfree_skb(skb); |
152 | } | 173 | } |
153 | 174 | ||
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index e9cecca5c44d..7d5108a867ad 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -2093,6 +2093,9 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, | |||
2093 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 2093 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
2094 | int i, ret; | 2094 | int i, ret; |
2095 | 2095 | ||
2096 | if (!ieee80211_sdata_running(sdata)) | ||
2097 | return -ENETDOWN; | ||
2098 | |||
2096 | if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) { | 2099 | if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) { |
2097 | ret = drv_set_bitrate_mask(local, sdata, mask); | 2100 | ret = drv_set_bitrate_mask(local, sdata, mask); |
2098 | if (ret) | 2101 | if (ret) |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 91d84cc77bbf..66e4fcdd1c6b 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1352,6 +1352,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1352 | if (WARN_ON(!ifmgd->associated)) | 1352 | if (WARN_ON(!ifmgd->associated)) |
1353 | return; | 1353 | return; |
1354 | 1354 | ||
1355 | ieee80211_stop_poll(sdata); | ||
1356 | |||
1355 | memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); | 1357 | memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); |
1356 | 1358 | ||
1357 | ifmgd->associated = NULL; | 1359 | ifmgd->associated = NULL; |
@@ -2612,8 +2614,6 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata, | |||
2612 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 2614 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
2613 | u8 frame_buf[DEAUTH_DISASSOC_LEN]; | 2615 | u8 frame_buf[DEAUTH_DISASSOC_LEN]; |
2614 | 2616 | ||
2615 | ieee80211_stop_poll(sdata); | ||
2616 | |||
2617 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, | 2617 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, |
2618 | false, frame_buf); | 2618 | false, frame_buf); |
2619 | mutex_unlock(&ifmgd->mtx); | 2619 | mutex_unlock(&ifmgd->mtx); |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 3bb24a121c95..a470e1123a55 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -271,6 +271,9 @@ struct sta_ampdu_mlme { | |||
271 | * @plink_timer: peer link watch timer | 271 | * @plink_timer: peer link watch timer |
272 | * @plink_timer_was_running: used by suspend/resume to restore timers | 272 | * @plink_timer_was_running: used by suspend/resume to restore timers |
273 | * @t_offset: timing offset relative to this host | 273 | * @t_offset: timing offset relative to this host |
274 | * @t_offset_setpoint: reference timing offset of this sta to be used when | ||
275 | * calculating clockdrift | ||
276 | * @ch_type: peer's channel type | ||
274 | * @debugfs: debug filesystem info | 277 | * @debugfs: debug filesystem info |
275 | * @dead: set to true when sta is unlinked | 278 | * @dead: set to true when sta is unlinked |
276 | * @uploaded: set to true when sta is uploaded to the driver | 279 | * @uploaded: set to true when sta is uploaded to the driver |
@@ -278,6 +281,8 @@ struct sta_ampdu_mlme { | |||
278 | * @sta: station information we share with the driver | 281 | * @sta: station information we share with the driver |
279 | * @sta_state: duplicates information about station state (for debug) | 282 | * @sta_state: duplicates information about station state (for debug) |
280 | * @beacon_loss_count: number of times beacon loss has triggered | 283 | * @beacon_loss_count: number of times beacon loss has triggered |
284 | * @supports_40mhz: tracks whether the station advertised 40 MHz support | ||
285 | * as we overwrite its HT parameters with the currently used value | ||
281 | */ | 286 | */ |
282 | struct sta_info { | 287 | struct sta_info { |
283 | /* General information, mostly static */ | 288 | /* General information, mostly static */ |
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c index 8781d8f904d9..434b6873b352 100644 --- a/net/mac802154/tx.c +++ b/net/mac802154/tx.c | |||
@@ -83,9 +83,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, | |||
83 | { | 83 | { |
84 | struct xmit_work *work; | 84 | struct xmit_work *work; |
85 | 85 | ||
86 | if (!(priv->phy->channels_supported[page] & (1 << chan))) | 86 | if (!(priv->phy->channels_supported[page] & (1 << chan))) { |
87 | WARN_ON(1); | 87 | WARN_ON(1); |
88 | return NETDEV_TX_OK; | 88 | return NETDEV_TX_OK; |
89 | } | ||
89 | 90 | ||
90 | if (!(priv->hw.flags & IEEE802154_HW_OMIT_CKSUM)) { | 91 | if (!(priv->hw.flags & IEEE802154_HW_OMIT_CKSUM)) { |
91 | u16 crc = crc_ccitt(0, skb->data, skb->len); | 92 | u16 crc = crc_ccitt(0, skb->data, skb->len); |
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index 779ce4ff92ec..5a940dbd74a3 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
@@ -5,8 +5,8 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Authors: Sakari Ailus <sakari.ailus@nokia.com> |
9 | * Original author: Sakari Ailus <sakari.ailus@nokia.com> | 9 | * Rémi Denis-Courmont |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
12 | * modify it under the terms of the GNU General Public License | 12 | * modify it under the terms of the GNU General Public License |
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c index bf35b4e1a14c..12c30f3e643e 100644 --- a/net/phonet/datagram.c +++ b/net/phonet/datagram.c | |||
@@ -5,8 +5,8 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Authors: Sakari Ailus <sakari.ailus@nokia.com> |
9 | * Original author: Sakari Ailus <sakari.ailus@nokia.com> | 9 | * Rémi Denis-Courmont |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
12 | * modify it under the terms of the GNU General Public License | 12 | * modify it under the terms of the GNU General Public License |
diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c index d01208968c83..a2fba7edfd1f 100644 --- a/net/phonet/pep-gprs.c +++ b/net/phonet/pep-gprs.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Author: Rémi Denis-Courmont |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or | 10 | * This program is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU General Public License | 11 | * modify it under the terms of the GNU General Public License |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 9dd4f926f7d1..576f22c9c76e 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Author: Rémi Denis-Courmont |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or | 10 | * This program is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU General Public License | 11 | * modify it under the terms of the GNU General Public License |
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 36f75a9e2c3d..5bf6341e2dd4 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -5,8 +5,8 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Authors: Sakari Ailus <sakari.ailus@nokia.com> |
9 | * Original author: Sakari Ailus <sakari.ailus@nokia.com> | 9 | * Rémi Denis-Courmont |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
12 | * modify it under the terms of the GNU General Public License | 12 | * modify it under the terms of the GNU General Public License |
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index cfdf135fcd69..7dd762a464e5 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c | |||
@@ -5,8 +5,8 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Authors: Sakari Ailus <sakari.ailus@nokia.com> |
9 | * Original author: Sakari Ailus <sakari.ailus@nokia.com> | 9 | * Remi Denis-Courmont |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
12 | * modify it under the terms of the GNU General Public License | 12 | * modify it under the terms of the GNU General Public License |
diff --git a/net/phonet/socket.c b/net/phonet/socket.c index 89cfa9ce4939..0acc943f713a 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c | |||
@@ -5,8 +5,8 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Authors: Sakari Ailus <sakari.ailus@nokia.com> |
9 | * Original author: Sakari Ailus <sakari.ailus@nokia.com> | 9 | * Rémi Denis-Courmont |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
12 | * modify it under the terms of the GNU General Public License | 12 | * modify it under the terms of the GNU General Public License |
diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c index 696348fd31a1..d6bbbbd0af18 100644 --- a/net/phonet/sysctl.c +++ b/net/phonet/sysctl.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2008 Nokia Corporation. | 6 | * Copyright (C) 2008 Nokia Corporation. |
7 | * | 7 | * |
8 | * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 8 | * Author: Rémi Denis-Courmont |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or | 10 | * This program is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU General Public License | 11 | * modify it under the terms of the GNU General Public License |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5942d27b1444..9c90811d1134 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -673,7 +673,9 @@ void sctp_addr_wq_timeout_handler(unsigned long arg) | |||
673 | SCTP_DEBUG_PRINTK("sctp_addrwq_timo_handler: sctp_asconf_mgmt failed\n"); | 673 | SCTP_DEBUG_PRINTK("sctp_addrwq_timo_handler: sctp_asconf_mgmt failed\n"); |
674 | sctp_bh_unlock_sock(sk); | 674 | sctp_bh_unlock_sock(sk); |
675 | } | 675 | } |
676 | #if IS_ENABLED(CONFIG_IPV6) | ||
676 | free_next: | 677 | free_next: |
678 | #endif | ||
677 | list_del(&addrw->list); | 679 | list_del(&addrw->list); |
678 | kfree(addrw); | 680 | kfree(addrw); |
679 | } | 681 | } |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 15f347477a99..baf5704740ee 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1389,7 +1389,7 @@ static void reg_set_request_processed(void) | |||
1389 | spin_unlock(®_requests_lock); | 1389 | spin_unlock(®_requests_lock); |
1390 | 1390 | ||
1391 | if (last_request->initiator == NL80211_REGDOM_SET_BY_USER) | 1391 | if (last_request->initiator == NL80211_REGDOM_SET_BY_USER) |
1392 | cancel_delayed_work_sync(®_timeout); | 1392 | cancel_delayed_work(®_timeout); |
1393 | 1393 | ||
1394 | if (need_more_processing) | 1394 | if (need_more_processing) |
1395 | schedule_work(®_work); | 1395 | schedule_work(®_work); |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 8f2d68fc3a44..316cfd00914f 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -804,7 +804,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, | |||
804 | ntype == NL80211_IFTYPE_P2P_CLIENT)) | 804 | ntype == NL80211_IFTYPE_P2P_CLIENT)) |
805 | return -EBUSY; | 805 | return -EBUSY; |
806 | 806 | ||
807 | if (ntype != otype) { | 807 | if (ntype != otype && netif_running(dev)) { |
808 | err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr, | 808 | err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr, |
809 | ntype); | 809 | ntype); |
810 | if (err) | 810 | if (err) |