diff options
Diffstat (limited to 'net')
49 files changed, 204 insertions, 214 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index d4d9926c2201..65106fb61b8f 100644 --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h | |||
@@ -151,9 +151,9 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...); | |||
151 | } \ | 151 | } \ |
152 | while (0) | 152 | while (0) |
153 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ | 153 | #else /* !CONFIG_BATMAN_ADV_DEBUG */ |
154 | static inline void bat_dbg(char type __attribute__((unused)), | 154 | static inline void bat_dbg(char type __always_unused, |
155 | struct bat_priv *bat_priv __attribute__((unused)), | 155 | struct bat_priv *bat_priv __always_unused, |
156 | char *fmt __attribute__((unused)), ...) | 156 | char *fmt __always_unused, ...) |
157 | { | 157 | { |
158 | } | 158 | } |
159 | #endif | 159 | #endif |
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index b49fdf70a6d5..2284e8129cb2 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h | |||
@@ -63,7 +63,7 @@ struct batman_packet { | |||
63 | uint8_t num_hna; | 63 | uint8_t num_hna; |
64 | uint8_t gw_flags; /* flags related to gateway class */ | 64 | uint8_t gw_flags; /* flags related to gateway class */ |
65 | uint8_t align; | 65 | uint8_t align; |
66 | } __attribute__((packed)); | 66 | } __packed; |
67 | 67 | ||
68 | #define BAT_PACKET_LEN sizeof(struct batman_packet) | 68 | #define BAT_PACKET_LEN sizeof(struct batman_packet) |
69 | 69 | ||
@@ -76,7 +76,7 @@ struct icmp_packet { | |||
76 | uint8_t orig[6]; | 76 | uint8_t orig[6]; |
77 | uint16_t seqno; | 77 | uint16_t seqno; |
78 | uint8_t uid; | 78 | uint8_t uid; |
79 | } __attribute__((packed)); | 79 | } __packed; |
80 | 80 | ||
81 | #define BAT_RR_LEN 16 | 81 | #define BAT_RR_LEN 16 |
82 | 82 | ||
@@ -93,14 +93,14 @@ struct icmp_packet_rr { | |||
93 | uint8_t uid; | 93 | uint8_t uid; |
94 | uint8_t rr_cur; | 94 | uint8_t rr_cur; |
95 | uint8_t rr[BAT_RR_LEN][ETH_ALEN]; | 95 | uint8_t rr[BAT_RR_LEN][ETH_ALEN]; |
96 | } __attribute__((packed)); | 96 | } __packed; |
97 | 97 | ||
98 | struct unicast_packet { | 98 | struct unicast_packet { |
99 | uint8_t packet_type; | 99 | uint8_t packet_type; |
100 | uint8_t version; /* batman version field */ | 100 | uint8_t version; /* batman version field */ |
101 | uint8_t dest[6]; | 101 | uint8_t dest[6]; |
102 | uint8_t ttl; | 102 | uint8_t ttl; |
103 | } __attribute__((packed)); | 103 | } __packed; |
104 | 104 | ||
105 | struct unicast_frag_packet { | 105 | struct unicast_frag_packet { |
106 | uint8_t packet_type; | 106 | uint8_t packet_type; |
@@ -110,7 +110,7 @@ struct unicast_frag_packet { | |||
110 | uint8_t flags; | 110 | uint8_t flags; |
111 | uint8_t orig[6]; | 111 | uint8_t orig[6]; |
112 | uint16_t seqno; | 112 | uint16_t seqno; |
113 | } __attribute__((packed)); | 113 | } __packed; |
114 | 114 | ||
115 | struct bcast_packet { | 115 | struct bcast_packet { |
116 | uint8_t packet_type; | 116 | uint8_t packet_type; |
@@ -118,7 +118,7 @@ struct bcast_packet { | |||
118 | uint8_t orig[6]; | 118 | uint8_t orig[6]; |
119 | uint8_t ttl; | 119 | uint8_t ttl; |
120 | uint32_t seqno; | 120 | uint32_t seqno; |
121 | } __attribute__((packed)); | 121 | } __packed; |
122 | 122 | ||
123 | struct vis_packet { | 123 | struct vis_packet { |
124 | uint8_t packet_type; | 124 | uint8_t packet_type; |
@@ -131,6 +131,6 @@ struct vis_packet { | |||
131 | * neighbors */ | 131 | * neighbors */ |
132 | uint8_t target_orig[6]; /* who should receive this packet */ | 132 | uint8_t target_orig[6]; /* who should receive this packet */ |
133 | uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */ | 133 | uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */ |
134 | } __attribute__((packed)); | 134 | } __packed; |
135 | 135 | ||
136 | #endif /* _NET_BATMAN_ADV_PACKET_H_ */ | 136 | #endif /* _NET_BATMAN_ADV_PACKET_H_ */ |
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 97cb23dd3e69..bf3f6f5a12c4 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h | |||
@@ -246,13 +246,13 @@ struct vis_info { | |||
246 | /* this packet might be part of the vis send queue. */ | 246 | /* this packet might be part of the vis send queue. */ |
247 | struct sk_buff *skb_packet; | 247 | struct sk_buff *skb_packet; |
248 | /* vis_info may follow here*/ | 248 | /* vis_info may follow here*/ |
249 | } __attribute__((packed)); | 249 | } __packed; |
250 | 250 | ||
251 | struct vis_info_entry { | 251 | struct vis_info_entry { |
252 | uint8_t src[ETH_ALEN]; | 252 | uint8_t src[ETH_ALEN]; |
253 | uint8_t dest[ETH_ALEN]; | 253 | uint8_t dest[ETH_ALEN]; |
254 | uint8_t quality; /* quality = 0 means HNA */ | 254 | uint8_t quality; /* quality = 0 means HNA */ |
255 | } __attribute__((packed)); | 255 | } __packed; |
256 | 256 | ||
257 | struct recvlist_node { | 257 | struct recvlist_node { |
258 | struct list_head list; | 258 | struct list_head list; |
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index dc2e28bed844..ee41fef04b21 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
@@ -229,10 +229,12 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | |||
229 | if (!bat_priv->primary_if) | 229 | if (!bat_priv->primary_if) |
230 | goto dropped; | 230 | goto dropped; |
231 | 231 | ||
232 | unicast_packet = (struct unicast_packet *) skb->data; | 232 | frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len); |
233 | if (!frag_skb) | ||
234 | goto dropped; | ||
233 | 235 | ||
236 | unicast_packet = (struct unicast_packet *) skb->data; | ||
234 | memcpy(&tmp_uc, unicast_packet, uc_hdr_len); | 237 | memcpy(&tmp_uc, unicast_packet, uc_hdr_len); |
235 | frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len); | ||
236 | skb_split(skb, frag_skb, data_len / 2); | 238 | skb_split(skb, frag_skb, data_len / 2); |
237 | 239 | ||
238 | if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 || | 240 | if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 || |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 6b90a4191734..99cd8d9d891b 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -379,14 +379,10 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 | |||
379 | hci_conn_hold(acl); | 379 | hci_conn_hold(acl); |
380 | 380 | ||
381 | if (acl->state == BT_OPEN || acl->state == BT_CLOSED) { | 381 | if (acl->state == BT_OPEN || acl->state == BT_CLOSED) { |
382 | acl->sec_level = sec_level; | 382 | acl->sec_level = BT_SECURITY_LOW; |
383 | acl->pending_sec_level = sec_level; | ||
383 | acl->auth_type = auth_type; | 384 | acl->auth_type = auth_type; |
384 | hci_acl_connect(acl); | 385 | hci_acl_connect(acl); |
385 | } else { | ||
386 | if (acl->sec_level < sec_level) | ||
387 | acl->sec_level = sec_level; | ||
388 | if (acl->auth_type < auth_type) | ||
389 | acl->auth_type = auth_type; | ||
390 | } | 386 | } |
391 | 387 | ||
392 | if (type == ACL_LINK) | 388 | if (type == ACL_LINK) |
@@ -442,11 +438,17 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
442 | { | 438 | { |
443 | BT_DBG("conn %p", conn); | 439 | BT_DBG("conn %p", conn); |
444 | 440 | ||
441 | if (conn->pending_sec_level > sec_level) | ||
442 | sec_level = conn->pending_sec_level; | ||
443 | |||
445 | if (sec_level > conn->sec_level) | 444 | if (sec_level > conn->sec_level) |
446 | conn->sec_level = sec_level; | 445 | conn->pending_sec_level = sec_level; |
447 | else if (conn->link_mode & HCI_LM_AUTH) | 446 | else if (conn->link_mode & HCI_LM_AUTH) |
448 | return 1; | 447 | return 1; |
449 | 448 | ||
449 | /* Make sure we preserve an existing MITM requirement*/ | ||
450 | auth_type |= (conn->auth_type & 0x01); | ||
451 | |||
450 | conn->auth_type = auth_type; | 452 | conn->auth_type = auth_type; |
451 | 453 | ||
452 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { | 454 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 8b602d881fd7..9c4541bc488a 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1011,6 +1011,10 @@ int hci_unregister_dev(struct hci_dev *hdev) | |||
1011 | 1011 | ||
1012 | destroy_workqueue(hdev->workqueue); | 1012 | destroy_workqueue(hdev->workqueue); |
1013 | 1013 | ||
1014 | hci_dev_lock_bh(hdev); | ||
1015 | hci_blacklist_clear(hdev); | ||
1016 | hci_dev_unlock_bh(hdev); | ||
1017 | |||
1014 | __hci_dev_put(hdev); | 1018 | __hci_dev_put(hdev); |
1015 | 1019 | ||
1016 | return 0; | 1020 | return 0; |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 38100170d380..a290854fdaa6 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -692,13 +692,13 @@ static int hci_outgoing_auth_needed(struct hci_dev *hdev, | |||
692 | if (conn->state != BT_CONFIG || !conn->out) | 692 | if (conn->state != BT_CONFIG || !conn->out) |
693 | return 0; | 693 | return 0; |
694 | 694 | ||
695 | if (conn->sec_level == BT_SECURITY_SDP) | 695 | if (conn->pending_sec_level == BT_SECURITY_SDP) |
696 | return 0; | 696 | return 0; |
697 | 697 | ||
698 | /* Only request authentication for SSP connections or non-SSP | 698 | /* Only request authentication for SSP connections or non-SSP |
699 | * devices with sec_level HIGH */ | 699 | * devices with sec_level HIGH */ |
700 | if (!(hdev->ssp_mode > 0 && conn->ssp_mode > 0) && | 700 | if (!(hdev->ssp_mode > 0 && conn->ssp_mode > 0) && |
701 | conn->sec_level != BT_SECURITY_HIGH) | 701 | conn->pending_sec_level != BT_SECURITY_HIGH) |
702 | return 0; | 702 | return 0; |
703 | 703 | ||
704 | return 1; | 704 | return 1; |
@@ -1095,9 +1095,10 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s | |||
1095 | 1095 | ||
1096 | conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); | 1096 | conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle)); |
1097 | if (conn) { | 1097 | if (conn) { |
1098 | if (!ev->status) | 1098 | if (!ev->status) { |
1099 | conn->link_mode |= HCI_LM_AUTH; | 1099 | conn->link_mode |= HCI_LM_AUTH; |
1100 | else | 1100 | conn->sec_level = conn->pending_sec_level; |
1101 | } else | ||
1101 | conn->sec_level = BT_SECURITY_LOW; | 1102 | conn->sec_level = BT_SECURITY_LOW; |
1102 | 1103 | ||
1103 | clear_bit(HCI_CONN_AUTH_PEND, &conn->pend); | 1104 | clear_bit(HCI_CONN_AUTH_PEND, &conn->pend); |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index c791fcda7b2d..7550abb0c96a 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -305,33 +305,44 @@ static void l2cap_chan_del(struct sock *sk, int err) | |||
305 | } | 305 | } |
306 | } | 306 | } |
307 | 307 | ||
308 | /* Service level security */ | 308 | static inline u8 l2cap_get_auth_type(struct sock *sk) |
309 | static inline int l2cap_check_security(struct sock *sk) | ||
310 | { | 309 | { |
311 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; | 310 | if (sk->sk_type == SOCK_RAW) { |
312 | __u8 auth_type; | 311 | switch (l2cap_pi(sk)->sec_level) { |
312 | case BT_SECURITY_HIGH: | ||
313 | return HCI_AT_DEDICATED_BONDING_MITM; | ||
314 | case BT_SECURITY_MEDIUM: | ||
315 | return HCI_AT_DEDICATED_BONDING; | ||
316 | default: | ||
317 | return HCI_AT_NO_BONDING; | ||
318 | } | ||
319 | } else if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) { | ||
320 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW) | ||
321 | l2cap_pi(sk)->sec_level = BT_SECURITY_SDP; | ||
313 | 322 | ||
314 | if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) { | ||
315 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH) | 323 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH) |
316 | auth_type = HCI_AT_NO_BONDING_MITM; | 324 | return HCI_AT_NO_BONDING_MITM; |
317 | else | 325 | else |
318 | auth_type = HCI_AT_NO_BONDING; | 326 | return HCI_AT_NO_BONDING; |
319 | |||
320 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW) | ||
321 | l2cap_pi(sk)->sec_level = BT_SECURITY_SDP; | ||
322 | } else { | 327 | } else { |
323 | switch (l2cap_pi(sk)->sec_level) { | 328 | switch (l2cap_pi(sk)->sec_level) { |
324 | case BT_SECURITY_HIGH: | 329 | case BT_SECURITY_HIGH: |
325 | auth_type = HCI_AT_GENERAL_BONDING_MITM; | 330 | return HCI_AT_GENERAL_BONDING_MITM; |
326 | break; | ||
327 | case BT_SECURITY_MEDIUM: | 331 | case BT_SECURITY_MEDIUM: |
328 | auth_type = HCI_AT_GENERAL_BONDING; | 332 | return HCI_AT_GENERAL_BONDING; |
329 | break; | ||
330 | default: | 333 | default: |
331 | auth_type = HCI_AT_NO_BONDING; | 334 | return HCI_AT_NO_BONDING; |
332 | break; | ||
333 | } | 335 | } |
334 | } | 336 | } |
337 | } | ||
338 | |||
339 | /* Service level security */ | ||
340 | static inline int l2cap_check_security(struct sock *sk) | ||
341 | { | ||
342 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; | ||
343 | __u8 auth_type; | ||
344 | |||
345 | auth_type = l2cap_get_auth_type(sk); | ||
335 | 346 | ||
336 | return hci_conn_security(conn->hcon, l2cap_pi(sk)->sec_level, | 347 | return hci_conn_security(conn->hcon, l2cap_pi(sk)->sec_level, |
337 | auth_type); | 348 | auth_type); |
@@ -1068,39 +1079,7 @@ static int l2cap_do_connect(struct sock *sk) | |||
1068 | 1079 | ||
1069 | err = -ENOMEM; | 1080 | err = -ENOMEM; |
1070 | 1081 | ||
1071 | if (sk->sk_type == SOCK_RAW) { | 1082 | auth_type = l2cap_get_auth_type(sk); |
1072 | switch (l2cap_pi(sk)->sec_level) { | ||
1073 | case BT_SECURITY_HIGH: | ||
1074 | auth_type = HCI_AT_DEDICATED_BONDING_MITM; | ||
1075 | break; | ||
1076 | case BT_SECURITY_MEDIUM: | ||
1077 | auth_type = HCI_AT_DEDICATED_BONDING; | ||
1078 | break; | ||
1079 | default: | ||
1080 | auth_type = HCI_AT_NO_BONDING; | ||
1081 | break; | ||
1082 | } | ||
1083 | } else if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) { | ||
1084 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH) | ||
1085 | auth_type = HCI_AT_NO_BONDING_MITM; | ||
1086 | else | ||
1087 | auth_type = HCI_AT_NO_BONDING; | ||
1088 | |||
1089 | if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW) | ||
1090 | l2cap_pi(sk)->sec_level = BT_SECURITY_SDP; | ||
1091 | } else { | ||
1092 | switch (l2cap_pi(sk)->sec_level) { | ||
1093 | case BT_SECURITY_HIGH: | ||
1094 | auth_type = HCI_AT_GENERAL_BONDING_MITM; | ||
1095 | break; | ||
1096 | case BT_SECURITY_MEDIUM: | ||
1097 | auth_type = HCI_AT_GENERAL_BONDING; | ||
1098 | break; | ||
1099 | default: | ||
1100 | auth_type = HCI_AT_NO_BONDING; | ||
1101 | break; | ||
1102 | } | ||
1103 | } | ||
1104 | 1083 | ||
1105 | hcon = hci_connect(hdev, ACL_LINK, dst, | 1084 | hcon = hci_connect(hdev, ACL_LINK, dst, |
1106 | l2cap_pi(sk)->sec_level, auth_type); | 1085 | l2cap_pi(sk)->sec_level, auth_type); |
@@ -1127,7 +1106,8 @@ static int l2cap_do_connect(struct sock *sk) | |||
1127 | if (sk->sk_type != SOCK_SEQPACKET && | 1106 | if (sk->sk_type != SOCK_SEQPACKET && |
1128 | sk->sk_type != SOCK_STREAM) { | 1107 | sk->sk_type != SOCK_STREAM) { |
1129 | l2cap_sock_clear_timer(sk); | 1108 | l2cap_sock_clear_timer(sk); |
1130 | sk->sk_state = BT_CONNECTED; | 1109 | if (l2cap_check_security(sk)) |
1110 | sk->sk_state = BT_CONNECTED; | ||
1131 | } else | 1111 | } else |
1132 | l2cap_do_start(sk); | 1112 | l2cap_do_start(sk); |
1133 | } | 1113 | } |
@@ -1893,8 +1873,8 @@ static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct ms | |||
1893 | if (pi->mode == L2CAP_MODE_STREAMING) { | 1873 | if (pi->mode == L2CAP_MODE_STREAMING) { |
1894 | l2cap_streaming_send(sk); | 1874 | l2cap_streaming_send(sk); |
1895 | } else { | 1875 | } else { |
1896 | if (pi->conn_state & L2CAP_CONN_REMOTE_BUSY && | 1876 | if ((pi->conn_state & L2CAP_CONN_REMOTE_BUSY) && |
1897 | pi->conn_state && L2CAP_CONN_WAIT_F) { | 1877 | (pi->conn_state & L2CAP_CONN_WAIT_F)) { |
1898 | err = len; | 1878 | err = len; |
1899 | break; | 1879 | break; |
1900 | } | 1880 | } |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index ff8aaa736650..6b83776534fb 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -1164,7 +1164,8 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci) | |||
1164 | * initiator rfcomm_process_rx already calls | 1164 | * initiator rfcomm_process_rx already calls |
1165 | * rfcomm_session_put() */ | 1165 | * rfcomm_session_put() */ |
1166 | if (s->sock->sk->sk_state != BT_CLOSED) | 1166 | if (s->sock->sk->sk_state != BT_CLOSED) |
1167 | rfcomm_session_put(s); | 1167 | if (list_empty(&s->dlcs)) |
1168 | rfcomm_session_put(s); | ||
1168 | break; | 1169 | break; |
1169 | } | 1170 | } |
1170 | } | 1171 | } |
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c index 21ede141018a..c665de778b60 100644 --- a/net/caif/cfcnfg.c +++ b/net/caif/cfcnfg.c | |||
@@ -191,6 +191,7 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer) | |||
191 | struct cflayer *servl = NULL; | 191 | struct cflayer *servl = NULL; |
192 | struct cfcnfg_phyinfo *phyinfo = NULL; | 192 | struct cfcnfg_phyinfo *phyinfo = NULL; |
193 | u8 phyid = 0; | 193 | u8 phyid = 0; |
194 | |||
194 | caif_assert(adap_layer != NULL); | 195 | caif_assert(adap_layer != NULL); |
195 | channel_id = adap_layer->id; | 196 | channel_id = adap_layer->id; |
196 | if (adap_layer->dn == NULL || channel_id == 0) { | 197 | if (adap_layer->dn == NULL || channel_id == 0) { |
@@ -199,16 +200,16 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer) | |||
199 | goto end; | 200 | goto end; |
200 | } | 201 | } |
201 | servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id); | 202 | servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id); |
202 | if (servl == NULL) | ||
203 | goto end; | ||
204 | layer_set_up(servl, NULL); | ||
205 | ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer); | ||
206 | if (servl == NULL) { | 203 | if (servl == NULL) { |
207 | pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)", | 204 | pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)", |
208 | channel_id); | 205 | channel_id); |
209 | ret = -EINVAL; | 206 | ret = -EINVAL; |
210 | goto end; | 207 | goto end; |
211 | } | 208 | } |
209 | layer_set_up(servl, NULL); | ||
210 | ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer); | ||
211 | if (ret) | ||
212 | goto end; | ||
212 | caif_assert(channel_id == servl->id); | 213 | caif_assert(channel_id == servl->id); |
213 | if (adap_layer->dn != NULL) { | 214 | if (adap_layer->dn != NULL) { |
214 | phyid = cfsrvl_getphyid(adap_layer->dn); | 215 | phyid = cfsrvl_getphyid(adap_layer->dn); |
diff --git a/net/can/bcm.c b/net/can/bcm.c index 9d5e8accfab1..092dc88a7c64 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -1256,6 +1256,9 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1256 | struct sockaddr_can *addr = | 1256 | struct sockaddr_can *addr = |
1257 | (struct sockaddr_can *)msg->msg_name; | 1257 | (struct sockaddr_can *)msg->msg_name; |
1258 | 1258 | ||
1259 | if (msg->msg_namelen < sizeof(*addr)) | ||
1260 | return -EINVAL; | ||
1261 | |||
1259 | if (addr->can_family != AF_CAN) | 1262 | if (addr->can_family != AF_CAN) |
1260 | return -EINVAL; | 1263 | return -EINVAL; |
1261 | 1264 | ||
diff --git a/net/can/raw.c b/net/can/raw.c index e88f610fdb7b..883e9d74fddf 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -649,6 +649,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
649 | struct sockaddr_can *addr = | 649 | struct sockaddr_can *addr = |
650 | (struct sockaddr_can *)msg->msg_name; | 650 | (struct sockaddr_can *)msg->msg_name; |
651 | 651 | ||
652 | if (msg->msg_namelen < sizeof(*addr)) | ||
653 | return -EINVAL; | ||
654 | |||
652 | if (addr->can_family != AF_CAN) | 655 | if (addr->can_family != AF_CAN) |
653 | return -EINVAL; | 656 | return -EINVAL; |
654 | 657 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index 54277df0f735..24ea2d71e7ea 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -749,7 +749,8 @@ EXPORT_SYMBOL(dev_get_by_index); | |||
749 | * @ha: hardware address | 749 | * @ha: hardware address |
750 | * | 750 | * |
751 | * Search for an interface by MAC address. Returns NULL if the device | 751 | * Search for an interface by MAC address. Returns NULL if the device |
752 | * is not found or a pointer to the device. The caller must hold RCU | 752 | * is not found or a pointer to the device. |
753 | * The caller must hold RCU or RTNL. | ||
753 | * The returned device has not had its ref count increased | 754 | * The returned device has not had its ref count increased |
754 | * and the caller must therefore be careful about locking | 755 | * and the caller must therefore be careful about locking |
755 | * | 756 | * |
@@ -2001,7 +2002,7 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol) | |||
2001 | 2002 | ||
2002 | static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) | 2003 | static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) |
2003 | { | 2004 | { |
2004 | if (!can_checksum_protocol(protocol, features)) { | 2005 | if (!can_checksum_protocol(features, protocol)) { |
2005 | features &= ~NETIF_F_ALL_CSUM; | 2006 | features &= ~NETIF_F_ALL_CSUM; |
2006 | features &= ~NETIF_F_SG; | 2007 | features &= ~NETIF_F_SG; |
2007 | } else if (illegal_highdma(skb->dev, skb)) { | 2008 | } else if (illegal_highdma(skb->dev, skb)) { |
@@ -2023,13 +2024,13 @@ int netif_skb_features(struct sk_buff *skb) | |||
2023 | return harmonize_features(skb, protocol, features); | 2024 | return harmonize_features(skb, protocol, features); |
2024 | } | 2025 | } |
2025 | 2026 | ||
2026 | features &= skb->dev->vlan_features; | 2027 | features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_TX); |
2027 | 2028 | ||
2028 | if (protocol != htons(ETH_P_8021Q)) { | 2029 | if (protocol != htons(ETH_P_8021Q)) { |
2029 | return harmonize_features(skb, protocol, features); | 2030 | return harmonize_features(skb, protocol, features); |
2030 | } else { | 2031 | } else { |
2031 | features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | | 2032 | features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | |
2032 | NETIF_F_GEN_CSUM; | 2033 | NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_TX; |
2033 | return harmonize_features(skb, protocol, features); | 2034 | return harmonize_features(skb, protocol, features); |
2034 | } | 2035 | } |
2035 | } | 2036 | } |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 17741782a345..ff2302910b5e 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -817,7 +817,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) | |||
817 | if (regs.len > reglen) | 817 | if (regs.len > reglen) |
818 | regs.len = reglen; | 818 | regs.len = reglen; |
819 | 819 | ||
820 | regbuf = vmalloc(reglen); | 820 | regbuf = vzalloc(reglen); |
821 | if (!regbuf) | 821 | if (!regbuf) |
822 | return -ENOMEM; | 822 | return -ENOMEM; |
823 | 823 | ||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a5f7535aab5b..750db57f3bb3 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1820,7 +1820,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
1820 | if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) | 1820 | if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) |
1821 | return -EPERM; | 1821 | return -EPERM; |
1822 | 1822 | ||
1823 | if (kind == 2 && (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { | 1823 | if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) { |
1824 | struct sock *rtnl; | 1824 | struct sock *rtnl; |
1825 | rtnl_dumpit_func dumpit; | 1825 | rtnl_dumpit_func dumpit; |
1826 | 1826 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index d31bb36ae0dc..7cd1bc86d591 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2744,8 +2744,12 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2744 | 2744 | ||
2745 | merge: | 2745 | merge: |
2746 | if (offset > headlen) { | 2746 | if (offset > headlen) { |
2747 | skbinfo->frags[0].page_offset += offset - headlen; | 2747 | unsigned int eat = offset - headlen; |
2748 | skbinfo->frags[0].size -= offset - headlen; | 2748 | |
2749 | skbinfo->frags[0].page_offset += eat; | ||
2750 | skbinfo->frags[0].size -= eat; | ||
2751 | skb->data_len -= eat; | ||
2752 | skb->len -= eat; | ||
2749 | offset = headlen; | 2753 | offset = headlen; |
2750 | } | 2754 | } |
2751 | 2755 | ||
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index d900ab99814a..6b03f561caec 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c | |||
@@ -583,7 +583,7 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb, | |||
583 | u8 up, idtype; | 583 | u8 up, idtype; |
584 | int ret = -EINVAL; | 584 | int ret = -EINVAL; |
585 | 585 | ||
586 | if (!tb[DCB_ATTR_APP] || !netdev->dcbnl_ops->getapp) | 586 | if (!tb[DCB_ATTR_APP]) |
587 | goto out; | 587 | goto out; |
588 | 588 | ||
589 | ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], | 589 | ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], |
@@ -604,7 +604,16 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb, | |||
604 | goto out; | 604 | goto out; |
605 | 605 | ||
606 | id = nla_get_u16(app_tb[DCB_APP_ATTR_ID]); | 606 | id = nla_get_u16(app_tb[DCB_APP_ATTR_ID]); |
607 | up = netdev->dcbnl_ops->getapp(netdev, idtype, id); | 607 | |
608 | if (netdev->dcbnl_ops->getapp) { | ||
609 | up = netdev->dcbnl_ops->getapp(netdev, idtype, id); | ||
610 | } else { | ||
611 | struct dcb_app app = { | ||
612 | .selector = idtype, | ||
613 | .protocol = id, | ||
614 | }; | ||
615 | up = dcb_getapp(netdev, &app); | ||
616 | } | ||
608 | 617 | ||
609 | /* send this back */ | 618 | /* send this back */ |
610 | dcbnl_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); | 619 | dcbnl_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 0c877a74e1f4..3fb14b7c13cf 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -428,7 +428,7 @@ static void __exit dsa_cleanup_module(void) | |||
428 | } | 428 | } |
429 | module_exit(dsa_cleanup_module); | 429 | module_exit(dsa_cleanup_module); |
430 | 430 | ||
431 | MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>") | 431 | MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>"); |
432 | MODULE_DESCRIPTION("Driver for Distributed Switch Architecture switch chips"); | 432 | MODULE_DESCRIPTION("Driver for Distributed Switch Architecture switch chips"); |
433 | MODULE_LICENSE("GPL"); | 433 | MODULE_LICENSE("GPL"); |
434 | MODULE_ALIAS("platform:dsa"); | 434 | MODULE_ALIAS("platform:dsa"); |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 04c8b69fd426..7927589813b5 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -1017,14 +1017,13 @@ static int arp_req_set_proxy(struct net *net, struct net_device *dev, int on) | |||
1017 | IPV4_DEVCONF_ALL(net, PROXY_ARP) = on; | 1017 | IPV4_DEVCONF_ALL(net, PROXY_ARP) = on; |
1018 | return 0; | 1018 | return 0; |
1019 | } | 1019 | } |
1020 | if (__in_dev_get_rcu(dev)) { | 1020 | if (__in_dev_get_rtnl(dev)) { |
1021 | IN_DEV_CONF_SET(__in_dev_get_rcu(dev), PROXY_ARP, on); | 1021 | IN_DEV_CONF_SET(__in_dev_get_rtnl(dev), PROXY_ARP, on); |
1022 | return 0; | 1022 | return 0; |
1023 | } | 1023 | } |
1024 | return -ENXIO; | 1024 | return -ENXIO; |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | /* must be called with rcu_read_lock() */ | ||
1028 | static int arp_req_set_public(struct net *net, struct arpreq *r, | 1027 | static int arp_req_set_public(struct net *net, struct arpreq *r, |
1029 | struct net_device *dev) | 1028 | struct net_device *dev) |
1030 | { | 1029 | { |
@@ -1233,10 +1232,10 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
1233 | if (!(r.arp_flags & ATF_NETMASK)) | 1232 | if (!(r.arp_flags & ATF_NETMASK)) |
1234 | ((struct sockaddr_in *)&r.arp_netmask)->sin_addr.s_addr = | 1233 | ((struct sockaddr_in *)&r.arp_netmask)->sin_addr.s_addr = |
1235 | htonl(0xFFFFFFFFUL); | 1234 | htonl(0xFFFFFFFFUL); |
1236 | rcu_read_lock(); | 1235 | rtnl_lock(); |
1237 | if (r.arp_dev[0]) { | 1236 | if (r.arp_dev[0]) { |
1238 | err = -ENODEV; | 1237 | err = -ENODEV; |
1239 | dev = dev_get_by_name_rcu(net, r.arp_dev); | 1238 | dev = __dev_get_by_name(net, r.arp_dev); |
1240 | if (dev == NULL) | 1239 | if (dev == NULL) |
1241 | goto out; | 1240 | goto out; |
1242 | 1241 | ||
@@ -1263,7 +1262,7 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
1263 | break; | 1262 | break; |
1264 | } | 1263 | } |
1265 | out: | 1264 | out: |
1266 | rcu_read_unlock(); | 1265 | rtnl_unlock(); |
1267 | if (cmd == SIOCGARP && !err && copy_to_user(arg, &r, sizeof(r))) | 1266 | if (cmd == SIOCGARP && !err && copy_to_user(arg, &r, sizeof(r))) |
1268 | err = -EFAULT; | 1267 | err = -EFAULT; |
1269 | return err; | 1268 | return err; |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 2746c1fa6417..2ada17129fce 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -858,7 +858,7 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
858 | nlmsg_len(nlh) < hdrlen) | 858 | nlmsg_len(nlh) < hdrlen) |
859 | return -EINVAL; | 859 | return -EINVAL; |
860 | 860 | ||
861 | if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { | 861 | if (nlh->nlmsg_flags & NLM_F_DUMP) { |
862 | if (nlmsg_attrlen(nlh, hdrlen)) { | 862 | if (nlmsg_attrlen(nlh, hdrlen)) { |
863 | struct nlattr *attr; | 863 | struct nlattr *attr; |
864 | 864 | ||
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index d9bc85751c74..a96e65674ac3 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
@@ -475,7 +475,7 @@ static int cleanup_once(unsigned long ttl) | |||
475 | struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create) | 475 | struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create) |
476 | { | 476 | { |
477 | struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr; | 477 | struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr; |
478 | struct inet_peer_base *base = family_to_base(AF_INET); | 478 | struct inet_peer_base *base = family_to_base(daddr->family); |
479 | struct inet_peer *p; | 479 | struct inet_peer *p; |
480 | 480 | ||
481 | /* Look up for the address quickly, lockless. | 481 | /* Look up for the address quickly, lockless. |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 2549b29b062d..eb7f82ebf4a3 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -4399,7 +4399,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) | |||
4399 | if (!skb_copy_datagram_iovec(skb, 0, tp->ucopy.iov, chunk)) { | 4399 | if (!skb_copy_datagram_iovec(skb, 0, tp->ucopy.iov, chunk)) { |
4400 | tp->ucopy.len -= chunk; | 4400 | tp->ucopy.len -= chunk; |
4401 | tp->copied_seq += chunk; | 4401 | tp->copied_seq += chunk; |
4402 | eaten = (chunk == skb->len && !th->fin); | 4402 | eaten = (chunk == skb->len); |
4403 | tcp_rcv_space_adjust(sk); | 4403 | tcp_rcv_space_adjust(sk); |
4404 | } | 4404 | } |
4405 | local_bh_disable(); | 4405 | local_bh_disable(); |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 856f68466d49..02f583b3744a 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1994,7 +1994,6 @@ static void *listening_get_next(struct seq_file *seq, void *cur) | |||
1994 | } | 1994 | } |
1995 | req = req->dl_next; | 1995 | req = req->dl_next; |
1996 | } | 1996 | } |
1997 | st->offset = 0; | ||
1998 | if (++st->sbucket >= icsk->icsk_accept_queue.listen_opt->nr_table_entries) | 1997 | if (++st->sbucket >= icsk->icsk_accept_queue.listen_opt->nr_table_entries) |
1999 | break; | 1998 | break; |
2000 | get_req: | 1999 | get_req: |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 5b189c97c2fc..fd6782e3a038 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -420,9 +420,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
420 | dev->type == ARPHRD_TUNNEL6 || | 420 | dev->type == ARPHRD_TUNNEL6 || |
421 | dev->type == ARPHRD_SIT || | 421 | dev->type == ARPHRD_SIT || |
422 | dev->type == ARPHRD_NONE) { | 422 | dev->type == ARPHRD_NONE) { |
423 | printk(KERN_INFO | ||
424 | "%s: Disabled Privacy Extensions\n", | ||
425 | dev->name); | ||
426 | ndev->cnf.use_tempaddr = -1; | 423 | ndev->cnf.use_tempaddr = -1; |
427 | } else { | 424 | } else { |
428 | in6_dev_hold(ndev); | 425 | in6_dev_hold(ndev); |
@@ -2664,14 +2661,12 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2664 | struct net *net = dev_net(dev); | 2661 | struct net *net = dev_net(dev); |
2665 | struct inet6_dev *idev; | 2662 | struct inet6_dev *idev; |
2666 | struct inet6_ifaddr *ifa; | 2663 | struct inet6_ifaddr *ifa; |
2667 | LIST_HEAD(keep_list); | 2664 | int state, i; |
2668 | int state; | ||
2669 | 2665 | ||
2670 | ASSERT_RTNL(); | 2666 | ASSERT_RTNL(); |
2671 | 2667 | ||
2672 | /* Flush routes if device is being removed or it is not loopback */ | 2668 | rt6_ifdown(net, dev); |
2673 | if (how || !(dev->flags & IFF_LOOPBACK)) | 2669 | neigh_ifdown(&nd_tbl, dev); |
2674 | rt6_ifdown(net, dev); | ||
2675 | 2670 | ||
2676 | idev = __in6_dev_get(dev); | 2671 | idev = __in6_dev_get(dev); |
2677 | if (idev == NULL) | 2672 | if (idev == NULL) |
@@ -2692,6 +2687,23 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2692 | 2687 | ||
2693 | } | 2688 | } |
2694 | 2689 | ||
2690 | /* Step 2: clear hash table */ | ||
2691 | for (i = 0; i < IN6_ADDR_HSIZE; i++) { | ||
2692 | struct hlist_head *h = &inet6_addr_lst[i]; | ||
2693 | struct hlist_node *n; | ||
2694 | |||
2695 | spin_lock_bh(&addrconf_hash_lock); | ||
2696 | restart: | ||
2697 | hlist_for_each_entry_rcu(ifa, n, h, addr_lst) { | ||
2698 | if (ifa->idev == idev) { | ||
2699 | hlist_del_init_rcu(&ifa->addr_lst); | ||
2700 | addrconf_del_timer(ifa); | ||
2701 | goto restart; | ||
2702 | } | ||
2703 | } | ||
2704 | spin_unlock_bh(&addrconf_hash_lock); | ||
2705 | } | ||
2706 | |||
2695 | write_lock_bh(&idev->lock); | 2707 | write_lock_bh(&idev->lock); |
2696 | 2708 | ||
2697 | /* Step 2: clear flags for stateless addrconf */ | 2709 | /* Step 2: clear flags for stateless addrconf */ |
@@ -2725,52 +2737,23 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2725 | struct inet6_ifaddr, if_list); | 2737 | struct inet6_ifaddr, if_list); |
2726 | addrconf_del_timer(ifa); | 2738 | addrconf_del_timer(ifa); |
2727 | 2739 | ||
2728 | /* If just doing link down, and address is permanent | 2740 | list_del(&ifa->if_list); |
2729 | and not link-local, then retain it. */ | ||
2730 | if (!how && | ||
2731 | (ifa->flags&IFA_F_PERMANENT) && | ||
2732 | !(ipv6_addr_type(&ifa->addr) & IPV6_ADDR_LINKLOCAL)) { | ||
2733 | list_move_tail(&ifa->if_list, &keep_list); | ||
2734 | |||
2735 | /* If not doing DAD on this address, just keep it. */ | ||
2736 | if ((dev->flags&(IFF_NOARP|IFF_LOOPBACK)) || | ||
2737 | idev->cnf.accept_dad <= 0 || | ||
2738 | (ifa->flags & IFA_F_NODAD)) | ||
2739 | continue; | ||
2740 | 2741 | ||
2741 | /* If it was tentative already, no need to notify */ | 2742 | write_unlock_bh(&idev->lock); |
2742 | if (ifa->flags & IFA_F_TENTATIVE) | ||
2743 | continue; | ||
2744 | 2743 | ||
2745 | /* Flag it for later restoration when link comes up */ | 2744 | spin_lock_bh(&ifa->state_lock); |
2746 | ifa->flags |= IFA_F_TENTATIVE; | 2745 | state = ifa->state; |
2747 | ifa->state = INET6_IFADDR_STATE_DAD; | 2746 | ifa->state = INET6_IFADDR_STATE_DEAD; |
2748 | } else { | 2747 | spin_unlock_bh(&ifa->state_lock); |
2749 | list_del(&ifa->if_list); | ||
2750 | |||
2751 | /* clear hash table */ | ||
2752 | spin_lock_bh(&addrconf_hash_lock); | ||
2753 | hlist_del_init_rcu(&ifa->addr_lst); | ||
2754 | spin_unlock_bh(&addrconf_hash_lock); | ||
2755 | |||
2756 | write_unlock_bh(&idev->lock); | ||
2757 | spin_lock_bh(&ifa->state_lock); | ||
2758 | state = ifa->state; | ||
2759 | ifa->state = INET6_IFADDR_STATE_DEAD; | ||
2760 | spin_unlock_bh(&ifa->state_lock); | ||
2761 | |||
2762 | if (state != INET6_IFADDR_STATE_DEAD) { | ||
2763 | __ipv6_ifa_notify(RTM_DELADDR, ifa); | ||
2764 | atomic_notifier_call_chain(&inet6addr_chain, | ||
2765 | NETDEV_DOWN, ifa); | ||
2766 | } | ||
2767 | 2748 | ||
2768 | in6_ifa_put(ifa); | 2749 | if (state != INET6_IFADDR_STATE_DEAD) { |
2769 | write_lock_bh(&idev->lock); | 2750 | __ipv6_ifa_notify(RTM_DELADDR, ifa); |
2751 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa); | ||
2770 | } | 2752 | } |
2771 | } | 2753 | in6_ifa_put(ifa); |
2772 | 2754 | ||
2773 | list_splice(&keep_list, &idev->addr_list); | 2755 | write_lock_bh(&idev->lock); |
2756 | } | ||
2774 | 2757 | ||
2775 | write_unlock_bh(&idev->lock); | 2758 | write_unlock_bh(&idev->lock); |
2776 | 2759 | ||
@@ -4159,8 +4142,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
4159 | addrconf_leave_solict(ifp->idev, &ifp->addr); | 4142 | addrconf_leave_solict(ifp->idev, &ifp->addr); |
4160 | dst_hold(&ifp->rt->dst); | 4143 | dst_hold(&ifp->rt->dst); |
4161 | 4144 | ||
4162 | if (ifp->state == INET6_IFADDR_STATE_DEAD && | 4145 | if (ip6_del_rt(ifp->rt)) |
4163 | ip6_del_rt(ifp->rt)) | ||
4164 | dst_free(&ifp->rt->dst); | 4146 | dst_free(&ifp->rt->dst); |
4165 | break; | 4147 | break; |
4166 | } | 4148 | } |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 373bd0416f69..1534508f6c68 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -72,8 +72,6 @@ | |||
72 | #define RT6_TRACE(x...) do { ; } while (0) | 72 | #define RT6_TRACE(x...) do { ; } while (0) |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | #define CLONE_OFFLINK_ROUTE 0 | ||
76 | |||
77 | static struct rt6_info * ip6_rt_copy(struct rt6_info *ort); | 75 | static struct rt6_info * ip6_rt_copy(struct rt6_info *ort); |
78 | static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); | 76 | static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); |
79 | static unsigned int ip6_default_advmss(const struct dst_entry *dst); | 77 | static unsigned int ip6_default_advmss(const struct dst_entry *dst); |
@@ -738,13 +736,8 @@ restart: | |||
738 | 736 | ||
739 | if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) | 737 | if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) |
740 | nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src); | 738 | nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src); |
741 | else { | 739 | else |
742 | #if CLONE_OFFLINK_ROUTE | ||
743 | nrt = rt6_alloc_clone(rt, &fl->fl6_dst); | 740 | nrt = rt6_alloc_clone(rt, &fl->fl6_dst); |
744 | #else | ||
745 | goto out2; | ||
746 | #endif | ||
747 | } | ||
748 | 741 | ||
749 | dst_release(&rt->dst); | 742 | dst_release(&rt->dst); |
750 | rt = nrt ? : net->ipv6.ip6_null_entry; | 743 | rt = nrt ? : net->ipv6.ip6_null_entry; |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 7e74023ea6e4..da87428681cc 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -98,6 +98,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, | |||
98 | if (!xdst->u.rt6.rt6i_idev) | 98 | if (!xdst->u.rt6.rt6i_idev) |
99 | return -ENODEV; | 99 | return -ENODEV; |
100 | 100 | ||
101 | xdst->u.rt6.rt6i_peer = rt->rt6i_peer; | ||
102 | if (rt->rt6i_peer) | ||
103 | atomic_inc(&rt->rt6i_peer->refcnt); | ||
104 | |||
101 | /* Sheit... I remember I did this right. Apparently, | 105 | /* Sheit... I remember I did this right. Apparently, |
102 | * it was magically lost, so this code needs audit */ | 106 | * it was magically lost, so this code needs audit */ |
103 | xdst->u.rt6.rt6i_flags = rt->rt6i_flags & (RTF_ANYCAST | | 107 | xdst->u.rt6.rt6i_flags = rt->rt6i_flags & (RTF_ANYCAST | |
@@ -216,6 +220,8 @@ static void xfrm6_dst_destroy(struct dst_entry *dst) | |||
216 | 220 | ||
217 | if (likely(xdst->u.rt6.rt6i_idev)) | 221 | if (likely(xdst->u.rt6.rt6i_idev)) |
218 | in6_dev_put(xdst->u.rt6.rt6i_idev); | 222 | in6_dev_put(xdst->u.rt6.rt6i_idev); |
223 | if (likely(xdst->u.rt6.rt6i_peer)) | ||
224 | inet_putpeer(xdst->u.rt6.rt6i_peer); | ||
219 | xfrm_dst_destroy(xdst); | 225 | xfrm_dst_destroy(xdst); |
220 | } | 226 | } |
221 | 227 | ||
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 9109262abd24..c766056d0488 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -20,7 +20,7 @@ config MAC80211_HAS_RC | |||
20 | def_bool n | 20 | def_bool n |
21 | 21 | ||
22 | config MAC80211_RC_PID | 22 | config MAC80211_RC_PID |
23 | bool "PID controller based rate control algorithm" if EMBEDDED | 23 | bool "PID controller based rate control algorithm" if EXPERT |
24 | select MAC80211_HAS_RC | 24 | select MAC80211_HAS_RC |
25 | ---help--- | 25 | ---help--- |
26 | This option enables a TX rate control algorithm for | 26 | This option enables a TX rate control algorithm for |
@@ -28,14 +28,14 @@ config MAC80211_RC_PID | |||
28 | rate. | 28 | rate. |
29 | 29 | ||
30 | config MAC80211_RC_MINSTREL | 30 | config MAC80211_RC_MINSTREL |
31 | bool "Minstrel" if EMBEDDED | 31 | bool "Minstrel" if EXPERT |
32 | select MAC80211_HAS_RC | 32 | select MAC80211_HAS_RC |
33 | default y | 33 | default y |
34 | ---help--- | 34 | ---help--- |
35 | This option enables the 'minstrel' TX rate control algorithm | 35 | This option enables the 'minstrel' TX rate control algorithm |
36 | 36 | ||
37 | config MAC80211_RC_MINSTREL_HT | 37 | config MAC80211_RC_MINSTREL_HT |
38 | bool "Minstrel 802.11n support" if EMBEDDED | 38 | bool "Minstrel 802.11n support" if EXPERT |
39 | depends on MAC80211_RC_MINSTREL | 39 | depends on MAC80211_RC_MINSTREL |
40 | default y | 40 | default y |
41 | ---help--- | 41 | ---help--- |
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index f138b195d657..227ca82eef72 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c | |||
@@ -185,8 +185,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, | |||
185 | struct ieee80211_mgmt *mgmt, | 185 | struct ieee80211_mgmt *mgmt, |
186 | size_t len) | 186 | size_t len) |
187 | { | 187 | { |
188 | struct ieee80211_hw *hw = &local->hw; | ||
189 | struct ieee80211_conf *conf = &hw->conf; | ||
190 | struct tid_ampdu_rx *tid_agg_rx; | 188 | struct tid_ampdu_rx *tid_agg_rx; |
191 | u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num, status; | 189 | u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num, status; |
192 | u8 dialog_token; | 190 | u8 dialog_token; |
@@ -231,13 +229,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, | |||
231 | goto end_no_lock; | 229 | goto end_no_lock; |
232 | } | 230 | } |
233 | /* determine default buffer size */ | 231 | /* determine default buffer size */ |
234 | if (buf_size == 0) { | 232 | if (buf_size == 0) |
235 | struct ieee80211_supported_band *sband; | 233 | buf_size = IEEE80211_MAX_AMPDU_BUF; |
236 | |||
237 | sband = local->hw.wiphy->bands[conf->channel->band]; | ||
238 | buf_size = IEEE80211_MIN_AMPDU_BUF; | ||
239 | buf_size = buf_size << sband->ht_cap.ampdu_factor; | ||
240 | } | ||
241 | 234 | ||
242 | 235 | ||
243 | /* examine state machine */ | 236 | /* examine state machine */ |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 485d36bc9a46..a46ff06d7cb8 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -39,6 +39,8 @@ module_param(ieee80211_disable_40mhz_24ghz, bool, 0644); | |||
39 | MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, | 39 | MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz, |
40 | "Disable 40MHz support in the 2.4GHz band"); | 40 | "Disable 40MHz support in the 2.4GHz band"); |
41 | 41 | ||
42 | static struct lock_class_key ieee80211_rx_skb_queue_class; | ||
43 | |||
42 | void ieee80211_configure_filter(struct ieee80211_local *local) | 44 | void ieee80211_configure_filter(struct ieee80211_local *local) |
43 | { | 45 | { |
44 | u64 mc; | 46 | u64 mc; |
@@ -569,7 +571,15 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
569 | spin_lock_init(&local->filter_lock); | 571 | spin_lock_init(&local->filter_lock); |
570 | spin_lock_init(&local->queue_stop_reason_lock); | 572 | spin_lock_init(&local->queue_stop_reason_lock); |
571 | 573 | ||
572 | skb_queue_head_init(&local->rx_skb_queue); | 574 | /* |
575 | * The rx_skb_queue is only accessed from tasklets, | ||
576 | * but other SKB queues are used from within IRQ | ||
577 | * context. Therefore, this one needs a different | ||
578 | * locking class so our direct, non-irq-safe use of | ||
579 | * the queue's lock doesn't throw lockdep warnings. | ||
580 | */ | ||
581 | skb_queue_head_init_class(&local->rx_skb_queue, | ||
582 | &ieee80211_rx_skb_queue_class); | ||
573 | 583 | ||
574 | INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); | 584 | INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); |
575 | 585 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5950e3abead9..b64b42bc774b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -2230,6 +2230,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, | |||
2230 | 2230 | ||
2231 | sdata = vif_to_sdata(vif); | 2231 | sdata = vif_to_sdata(vif); |
2232 | 2232 | ||
2233 | if (!ieee80211_sdata_running(sdata)) | ||
2234 | goto out; | ||
2235 | |||
2233 | if (tim_offset) | 2236 | if (tim_offset) |
2234 | *tim_offset = 0; | 2237 | *tim_offset = 0; |
2235 | if (tim_length) | 2238 | if (tim_length) |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 2b7eef37875c..93297aaceb2b 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -924,7 +924,7 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
924 | u16 zone; | 924 | u16 zone; |
925 | int err; | 925 | int err; |
926 | 926 | ||
927 | if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) | 927 | if (nlh->nlmsg_flags & NLM_F_DUMP) |
928 | return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table, | 928 | return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table, |
929 | ctnetlink_done); | 929 | ctnetlink_done); |
930 | 930 | ||
@@ -1787,7 +1787,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1787 | u16 zone; | 1787 | u16 zone; |
1788 | int err; | 1788 | int err; |
1789 | 1789 | ||
1790 | if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { | 1790 | if (nlh->nlmsg_flags & NLM_F_DUMP) { |
1791 | return netlink_dump_start(ctnl, skb, nlh, | 1791 | return netlink_dump_start(ctnl, skb, nlh, |
1792 | ctnetlink_exp_dump_table, | 1792 | ctnetlink_exp_dump_table, |
1793 | ctnetlink_exp_done); | 1793 | ctnetlink_exp_done); |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index f83cb370292b..1781d99145e2 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -519,7 +519,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
519 | security_netlink_recv(skb, CAP_NET_ADMIN)) | 519 | security_netlink_recv(skb, CAP_NET_ADMIN)) |
520 | return -EPERM; | 520 | return -EPERM; |
521 | 521 | ||
522 | if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { | 522 | if (nlh->nlmsg_flags & NLM_F_DUMP) { |
523 | if (ops->dumpit == NULL) | 523 | if (ops->dumpit == NULL) |
524 | return -EOPNOTSUPP; | 524 | return -EOPNOTSUPP; |
525 | 525 | ||
diff --git a/net/rfkill/Kconfig b/net/rfkill/Kconfig index eaf765876458..7fce6dfd2180 100644 --- a/net/rfkill/Kconfig +++ b/net/rfkill/Kconfig | |||
@@ -18,7 +18,7 @@ config RFKILL_LEDS | |||
18 | default y | 18 | default y |
19 | 19 | ||
20 | config RFKILL_INPUT | 20 | config RFKILL_INPUT |
21 | bool "RF switch input support" if EMBEDDED | 21 | bool "RF switch input support" if EXPERT |
22 | depends on RFKILL | 22 | depends on RFKILL |
23 | depends on INPUT = y || RFKILL = INPUT | 23 | depends on INPUT = y || RFKILL = INPUT |
24 | default y if !EMBEDDED | 24 | default y if !EXPERT |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index c80d1c210c5d..5f63ec58942c 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -390,7 +390,6 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
390 | ret = qdisc_enqueue(skb, cl->q); | 390 | ret = qdisc_enqueue(skb, cl->q); |
391 | if (ret == NET_XMIT_SUCCESS) { | 391 | if (ret == NET_XMIT_SUCCESS) { |
392 | sch->q.qlen++; | 392 | sch->q.qlen++; |
393 | qdisc_bstats_update(sch, skb); | ||
394 | cbq_mark_toplevel(q, cl); | 393 | cbq_mark_toplevel(q, cl); |
395 | if (!cl->next_alive) | 394 | if (!cl->next_alive) |
396 | cbq_activate_class(cl); | 395 | cbq_activate_class(cl); |
@@ -649,7 +648,6 @@ static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child) | |||
649 | ret = qdisc_enqueue(skb, cl->q); | 648 | ret = qdisc_enqueue(skb, cl->q); |
650 | if (ret == NET_XMIT_SUCCESS) { | 649 | if (ret == NET_XMIT_SUCCESS) { |
651 | sch->q.qlen++; | 650 | sch->q.qlen++; |
652 | qdisc_bstats_update(sch, skb); | ||
653 | if (!cl->next_alive) | 651 | if (!cl->next_alive) |
654 | cbq_activate_class(cl); | 652 | cbq_activate_class(cl); |
655 | return 0; | 653 | return 0; |
@@ -971,6 +969,7 @@ cbq_dequeue(struct Qdisc *sch) | |||
971 | 969 | ||
972 | skb = cbq_dequeue_1(sch); | 970 | skb = cbq_dequeue_1(sch); |
973 | if (skb) { | 971 | if (skb) { |
972 | qdisc_bstats_update(sch, skb); | ||
974 | sch->q.qlen--; | 973 | sch->q.qlen--; |
975 | sch->flags &= ~TCQ_F_THROTTLED; | 974 | sch->flags &= ~TCQ_F_THROTTLED; |
976 | return skb; | 975 | return skb; |
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index de55e642eafc..6b7fe4a84f13 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c | |||
@@ -376,7 +376,6 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
376 | } | 376 | } |
377 | 377 | ||
378 | bstats_update(&cl->bstats, skb); | 378 | bstats_update(&cl->bstats, skb); |
379 | qdisc_bstats_update(sch, skb); | ||
380 | 379 | ||
381 | sch->q.qlen++; | 380 | sch->q.qlen++; |
382 | return err; | 381 | return err; |
@@ -403,6 +402,7 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch) | |||
403 | skb = qdisc_dequeue_peeked(cl->qdisc); | 402 | skb = qdisc_dequeue_peeked(cl->qdisc); |
404 | if (cl->qdisc->q.qlen == 0) | 403 | if (cl->qdisc->q.qlen == 0) |
405 | list_del(&cl->alist); | 404 | list_del(&cl->alist); |
405 | qdisc_bstats_update(sch, skb); | ||
406 | sch->q.qlen--; | 406 | sch->q.qlen--; |
407 | return skb; | 407 | return skb; |
408 | } | 408 | } |
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 60f4bdd4408e..0f7bf3fdfea5 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c | |||
@@ -260,7 +260,6 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
260 | return err; | 260 | return err; |
261 | } | 261 | } |
262 | 262 | ||
263 | qdisc_bstats_update(sch, skb); | ||
264 | sch->q.qlen++; | 263 | sch->q.qlen++; |
265 | 264 | ||
266 | return NET_XMIT_SUCCESS; | 265 | return NET_XMIT_SUCCESS; |
@@ -283,6 +282,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) | |||
283 | if (skb == NULL) | 282 | if (skb == NULL) |
284 | return NULL; | 283 | return NULL; |
285 | 284 | ||
285 | qdisc_bstats_update(sch, skb); | ||
286 | sch->q.qlen--; | 286 | sch->q.qlen--; |
287 | 287 | ||
288 | index = skb->tc_index & (p->indices - 1); | 288 | index = skb->tc_index & (p->indices - 1); |
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c index aa4d6337e43c..d468b479aa93 100644 --- a/net/sched/sch_fifo.c +++ b/net/sched/sch_fifo.c | |||
@@ -46,17 +46,14 @@ static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
46 | 46 | ||
47 | static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc* sch) | 47 | static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc* sch) |
48 | { | 48 | { |
49 | struct sk_buff *skb_head; | ||
50 | struct fifo_sched_data *q = qdisc_priv(sch); | 49 | struct fifo_sched_data *q = qdisc_priv(sch); |
51 | 50 | ||
52 | if (likely(skb_queue_len(&sch->q) < q->limit)) | 51 | if (likely(skb_queue_len(&sch->q) < q->limit)) |
53 | return qdisc_enqueue_tail(skb, sch); | 52 | return qdisc_enqueue_tail(skb, sch); |
54 | 53 | ||
55 | /* queue full, remove one skb to fulfill the limit */ | 54 | /* queue full, remove one skb to fulfill the limit */ |
56 | skb_head = qdisc_dequeue_head(sch); | 55 | __qdisc_queue_drop_head(sch, &sch->q); |
57 | sch->qstats.drops++; | 56 | sch->qstats.drops++; |
58 | kfree_skb(skb_head); | ||
59 | |||
60 | qdisc_enqueue_tail(skb, sch); | 57 | qdisc_enqueue_tail(skb, sch); |
61 | 58 | ||
62 | return NET_XMIT_CN; | 59 | return NET_XMIT_CN; |
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 2e45791d4f6c..14a799de1c35 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -1600,7 +1600,6 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
1600 | set_active(cl, qdisc_pkt_len(skb)); | 1600 | set_active(cl, qdisc_pkt_len(skb)); |
1601 | 1601 | ||
1602 | bstats_update(&cl->bstats, skb); | 1602 | bstats_update(&cl->bstats, skb); |
1603 | qdisc_bstats_update(sch, skb); | ||
1604 | sch->q.qlen++; | 1603 | sch->q.qlen++; |
1605 | 1604 | ||
1606 | return NET_XMIT_SUCCESS; | 1605 | return NET_XMIT_SUCCESS; |
@@ -1666,6 +1665,7 @@ hfsc_dequeue(struct Qdisc *sch) | |||
1666 | } | 1665 | } |
1667 | 1666 | ||
1668 | sch->flags &= ~TCQ_F_THROTTLED; | 1667 | sch->flags &= ~TCQ_F_THROTTLED; |
1668 | qdisc_bstats_update(sch, skb); | ||
1669 | sch->q.qlen--; | 1669 | sch->q.qlen--; |
1670 | 1670 | ||
1671 | return skb; | 1671 | return skb; |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 984c1b0c6836..fc12fe6f5597 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -574,7 +574,6 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
574 | } | 574 | } |
575 | 575 | ||
576 | sch->q.qlen++; | 576 | sch->q.qlen++; |
577 | qdisc_bstats_update(sch, skb); | ||
578 | return NET_XMIT_SUCCESS; | 577 | return NET_XMIT_SUCCESS; |
579 | } | 578 | } |
580 | 579 | ||
@@ -842,7 +841,7 @@ next: | |||
842 | 841 | ||
843 | static struct sk_buff *htb_dequeue(struct Qdisc *sch) | 842 | static struct sk_buff *htb_dequeue(struct Qdisc *sch) |
844 | { | 843 | { |
845 | struct sk_buff *skb = NULL; | 844 | struct sk_buff *skb; |
846 | struct htb_sched *q = qdisc_priv(sch); | 845 | struct htb_sched *q = qdisc_priv(sch); |
847 | int level; | 846 | int level; |
848 | psched_time_t next_event; | 847 | psched_time_t next_event; |
@@ -851,6 +850,8 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
851 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ | 850 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ |
852 | skb = __skb_dequeue(&q->direct_queue); | 851 | skb = __skb_dequeue(&q->direct_queue); |
853 | if (skb != NULL) { | 852 | if (skb != NULL) { |
853 | ok: | ||
854 | qdisc_bstats_update(sch, skb); | ||
854 | sch->flags &= ~TCQ_F_THROTTLED; | 855 | sch->flags &= ~TCQ_F_THROTTLED; |
855 | sch->q.qlen--; | 856 | sch->q.qlen--; |
856 | return skb; | 857 | return skb; |
@@ -884,11 +885,8 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
884 | int prio = ffz(m); | 885 | int prio = ffz(m); |
885 | m |= 1 << prio; | 886 | m |= 1 << prio; |
886 | skb = htb_dequeue_tree(q, prio, level); | 887 | skb = htb_dequeue_tree(q, prio, level); |
887 | if (likely(skb != NULL)) { | 888 | if (likely(skb != NULL)) |
888 | sch->q.qlen--; | 889 | goto ok; |
889 | sch->flags &= ~TCQ_F_THROTTLED; | ||
890 | goto fin; | ||
891 | } | ||
892 | } | 890 | } |
893 | } | 891 | } |
894 | sch->qstats.overlimits++; | 892 | sch->qstats.overlimits++; |
diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 21f13da24763..436a2e75b322 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c | |||
@@ -83,7 +83,6 @@ multiq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
83 | 83 | ||
84 | ret = qdisc_enqueue(skb, qdisc); | 84 | ret = qdisc_enqueue(skb, qdisc); |
85 | if (ret == NET_XMIT_SUCCESS) { | 85 | if (ret == NET_XMIT_SUCCESS) { |
86 | qdisc_bstats_update(sch, skb); | ||
87 | sch->q.qlen++; | 86 | sch->q.qlen++; |
88 | return NET_XMIT_SUCCESS; | 87 | return NET_XMIT_SUCCESS; |
89 | } | 88 | } |
@@ -112,6 +111,7 @@ static struct sk_buff *multiq_dequeue(struct Qdisc *sch) | |||
112 | qdisc = q->queues[q->curband]; | 111 | qdisc = q->queues[q->curband]; |
113 | skb = qdisc->dequeue(qdisc); | 112 | skb = qdisc->dequeue(qdisc); |
114 | if (skb) { | 113 | if (skb) { |
114 | qdisc_bstats_update(sch, skb); | ||
115 | sch->q.qlen--; | 115 | sch->q.qlen--; |
116 | return skb; | 116 | return skb; |
117 | } | 117 | } |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 1c4bce863479..6a3006b38dc5 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -240,7 +240,6 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
240 | 240 | ||
241 | if (likely(ret == NET_XMIT_SUCCESS)) { | 241 | if (likely(ret == NET_XMIT_SUCCESS)) { |
242 | sch->q.qlen++; | 242 | sch->q.qlen++; |
243 | qdisc_bstats_update(sch, skb); | ||
244 | } else if (net_xmit_drop_count(ret)) { | 243 | } else if (net_xmit_drop_count(ret)) { |
245 | sch->qstats.drops++; | 244 | sch->qstats.drops++; |
246 | } | 245 | } |
@@ -289,6 +288,7 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) | |||
289 | skb->tstamp.tv64 = 0; | 288 | skb->tstamp.tv64 = 0; |
290 | #endif | 289 | #endif |
291 | pr_debug("netem_dequeue: return skb=%p\n", skb); | 290 | pr_debug("netem_dequeue: return skb=%p\n", skb); |
291 | qdisc_bstats_update(sch, skb); | ||
292 | sch->q.qlen--; | 292 | sch->q.qlen--; |
293 | return skb; | 293 | return skb; |
294 | } | 294 | } |
@@ -476,7 +476,6 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) | |||
476 | __skb_queue_after(list, skb, nskb); | 476 | __skb_queue_after(list, skb, nskb); |
477 | 477 | ||
478 | sch->qstats.backlog += qdisc_pkt_len(nskb); | 478 | sch->qstats.backlog += qdisc_pkt_len(nskb); |
479 | qdisc_bstats_update(sch, nskb); | ||
480 | 479 | ||
481 | return NET_XMIT_SUCCESS; | 480 | return NET_XMIT_SUCCESS; |
482 | } | 481 | } |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 966158d49dd1..fbd710d619bf 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -84,7 +84,6 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
84 | 84 | ||
85 | ret = qdisc_enqueue(skb, qdisc); | 85 | ret = qdisc_enqueue(skb, qdisc); |
86 | if (ret == NET_XMIT_SUCCESS) { | 86 | if (ret == NET_XMIT_SUCCESS) { |
87 | qdisc_bstats_update(sch, skb); | ||
88 | sch->q.qlen++; | 87 | sch->q.qlen++; |
89 | return NET_XMIT_SUCCESS; | 88 | return NET_XMIT_SUCCESS; |
90 | } | 89 | } |
@@ -116,6 +115,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc* sch) | |||
116 | struct Qdisc *qdisc = q->queues[prio]; | 115 | struct Qdisc *qdisc = q->queues[prio]; |
117 | struct sk_buff *skb = qdisc->dequeue(qdisc); | 116 | struct sk_buff *skb = qdisc->dequeue(qdisc); |
118 | if (skb) { | 117 | if (skb) { |
118 | qdisc_bstats_update(sch, skb); | ||
119 | sch->q.qlen--; | 119 | sch->q.qlen--; |
120 | return skb; | 120 | return skb; |
121 | } | 121 | } |
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index a6009c5a2c97..9f98dbd32d4c 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
@@ -94,7 +94,6 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
94 | 94 | ||
95 | ret = qdisc_enqueue(skb, child); | 95 | ret = qdisc_enqueue(skb, child); |
96 | if (likely(ret == NET_XMIT_SUCCESS)) { | 96 | if (likely(ret == NET_XMIT_SUCCESS)) { |
97 | qdisc_bstats_update(sch, skb); | ||
98 | sch->q.qlen++; | 97 | sch->q.qlen++; |
99 | } else if (net_xmit_drop_count(ret)) { | 98 | } else if (net_xmit_drop_count(ret)) { |
100 | q->stats.pdrop++; | 99 | q->stats.pdrop++; |
@@ -114,11 +113,13 @@ static struct sk_buff * red_dequeue(struct Qdisc* sch) | |||
114 | struct Qdisc *child = q->qdisc; | 113 | struct Qdisc *child = q->qdisc; |
115 | 114 | ||
116 | skb = child->dequeue(child); | 115 | skb = child->dequeue(child); |
117 | if (skb) | 116 | if (skb) { |
117 | qdisc_bstats_update(sch, skb); | ||
118 | sch->q.qlen--; | 118 | sch->q.qlen--; |
119 | else if (!red_is_idling(&q->parms)) | 119 | } else { |
120 | red_start_of_idle_period(&q->parms); | 120 | if (!red_is_idling(&q->parms)) |
121 | 121 | red_start_of_idle_period(&q->parms); | |
122 | } | ||
122 | return skb; | 123 | return skb; |
123 | } | 124 | } |
124 | 125 | ||
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 239ec53a634d..edea8cefec6c 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -402,10 +402,8 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
402 | q->tail = slot; | 402 | q->tail = slot; |
403 | slot->allot = q->scaled_quantum; | 403 | slot->allot = q->scaled_quantum; |
404 | } | 404 | } |
405 | if (++sch->q.qlen <= q->limit) { | 405 | if (++sch->q.qlen <= q->limit) |
406 | qdisc_bstats_update(sch, skb); | ||
407 | return NET_XMIT_SUCCESS; | 406 | return NET_XMIT_SUCCESS; |
408 | } | ||
409 | 407 | ||
410 | sfq_drop(sch); | 408 | sfq_drop(sch); |
411 | return NET_XMIT_CN; | 409 | return NET_XMIT_CN; |
@@ -445,6 +443,7 @@ next_slot: | |||
445 | } | 443 | } |
446 | skb = slot_dequeue_head(slot); | 444 | skb = slot_dequeue_head(slot); |
447 | sfq_dec(q, a); | 445 | sfq_dec(q, a); |
446 | qdisc_bstats_update(sch, skb); | ||
448 | sch->q.qlen--; | 447 | sch->q.qlen--; |
449 | sch->qstats.backlog -= qdisc_pkt_len(skb); | 448 | sch->qstats.backlog -= qdisc_pkt_len(skb); |
450 | 449 | ||
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 77565e721811..e93165820c3f 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -134,7 +134,6 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
134 | } | 134 | } |
135 | 135 | ||
136 | sch->q.qlen++; | 136 | sch->q.qlen++; |
137 | qdisc_bstats_update(sch, skb); | ||
138 | return NET_XMIT_SUCCESS; | 137 | return NET_XMIT_SUCCESS; |
139 | } | 138 | } |
140 | 139 | ||
@@ -187,6 +186,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch) | |||
187 | q->ptokens = ptoks; | 186 | q->ptokens = ptoks; |
188 | sch->q.qlen--; | 187 | sch->q.qlen--; |
189 | sch->flags &= ~TCQ_F_THROTTLED; | 188 | sch->flags &= ~TCQ_F_THROTTLED; |
189 | qdisc_bstats_update(sch, skb); | ||
190 | return skb; | 190 | return skb; |
191 | } | 191 | } |
192 | 192 | ||
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 84ce48eadff4..d84e7329660f 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -87,7 +87,6 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
87 | 87 | ||
88 | if (q->q.qlen < dev->tx_queue_len) { | 88 | if (q->q.qlen < dev->tx_queue_len) { |
89 | __skb_queue_tail(&q->q, skb); | 89 | __skb_queue_tail(&q->q, skb); |
90 | qdisc_bstats_update(sch, skb); | ||
91 | return NET_XMIT_SUCCESS; | 90 | return NET_XMIT_SUCCESS; |
92 | } | 91 | } |
93 | 92 | ||
@@ -111,6 +110,8 @@ teql_dequeue(struct Qdisc* sch) | |||
111 | dat->m->slaves = sch; | 110 | dat->m->slaves = sch; |
112 | netif_wake_queue(m); | 111 | netif_wake_queue(m); |
113 | } | 112 | } |
113 | } else { | ||
114 | qdisc_bstats_update(sch, skb); | ||
114 | } | 115 | } |
115 | sch->q.qlen = dat->q.qlen + dat_queue->qdisc->q.qlen; | 116 | sch->q.qlen = dat->q.qlen + dat_queue->qdisc->q.qlen; |
116 | return skb; | 117 | return skb; |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index a09b0dd25f50..8e02550ff3e8 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -3428,7 +3428,7 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname, | |||
3428 | retval = sctp_setsockopt_peer_addr_params(sk, optval, optlen); | 3428 | retval = sctp_setsockopt_peer_addr_params(sk, optval, optlen); |
3429 | break; | 3429 | break; |
3430 | 3430 | ||
3431 | case SCTP_DELAYED_ACK: | 3431 | case SCTP_DELAYED_SACK: |
3432 | retval = sctp_setsockopt_delayed_ack(sk, optval, optlen); | 3432 | retval = sctp_setsockopt_delayed_ack(sk, optval, optlen); |
3433 | break; | 3433 | break; |
3434 | case SCTP_PARTIAL_DELIVERY_POINT: | 3434 | case SCTP_PARTIAL_DELIVERY_POINT: |
@@ -5333,7 +5333,7 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, | |||
5333 | retval = sctp_getsockopt_peer_addr_params(sk, len, optval, | 5333 | retval = sctp_getsockopt_peer_addr_params(sk, len, optval, |
5334 | optlen); | 5334 | optlen); |
5335 | break; | 5335 | break; |
5336 | case SCTP_DELAYED_ACK: | 5336 | case SCTP_DELAYED_SACK: |
5337 | retval = sctp_getsockopt_delayed_ack(sk, len, optval, | 5337 | retval = sctp_getsockopt_delayed_ack(sk, len, optval, |
5338 | optlen); | 5338 | optlen); |
5339 | break; | 5339 | break; |
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index d0ee29063e5d..1f1ef70f34f2 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -95,7 +95,7 @@ config CFG80211_DEBUGFS | |||
95 | If unsure, say N. | 95 | If unsure, say N. |
96 | 96 | ||
97 | config CFG80211_INTERNAL_REGDB | 97 | config CFG80211_INTERNAL_REGDB |
98 | bool "use statically compiled regulatory rules database" if EMBEDDED | 98 | bool "use statically compiled regulatory rules database" if EXPERT |
99 | default n | 99 | default n |
100 | depends on CFG80211 | 100 | depends on CFG80211 |
101 | ---help--- | 101 | ---help--- |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index d5e1e0b08890..61291965c5f6 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -2189,7 +2189,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
2189 | 2189 | ||
2190 | if ((type == (XFRM_MSG_GETSA - XFRM_MSG_BASE) || | 2190 | if ((type == (XFRM_MSG_GETSA - XFRM_MSG_BASE) || |
2191 | type == (XFRM_MSG_GETPOLICY - XFRM_MSG_BASE)) && | 2191 | type == (XFRM_MSG_GETPOLICY - XFRM_MSG_BASE)) && |
2192 | (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { | 2192 | (nlh->nlmsg_flags & NLM_F_DUMP)) { |
2193 | if (link->dump == NULL) | 2193 | if (link->dump == NULL) |
2194 | return -EINVAL; | 2194 | return -EINVAL; |
2195 | 2195 | ||