diff options
-rw-r--r-- | drivers/net/ibmveth.c | 4 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 7 | ||||
-rw-r--r-- | drivers/net/r8169.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_pci.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 10 | ||||
-rw-r--r-- | drivers/vhost/net.c | 16 | ||||
-rw-r--r-- | include/net/sock.h | 7 | ||||
-rw-r--r-- | net/bluetooth/hci_conn.c | 5 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 2 | ||||
-rw-r--r-- | net/bluetooth/l2cap.c | 14 | ||||
-rw-r--r-- | net/core/dev.c | 20 | ||||
-rw-r--r-- | net/core/neighbour.c | 5 | ||||
-rw-r--r-- | net/dsa/Kconfig | 2 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 3 | ||||
-rw-r--r-- | net/ipv6/mip6.c | 3 | ||||
-rw-r--r-- | net/phonet/pep.c | 1 | ||||
-rw-r--r-- | net/sched/act_nat.c | 5 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 15 |
20 files changed, 92 insertions, 39 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 7acb3edc47ef..2602852cc55a 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -677,7 +677,7 @@ static int ibmveth_close(struct net_device *netdev) | |||
677 | if (!adapter->pool_config) | 677 | if (!adapter->pool_config) |
678 | netif_stop_queue(netdev); | 678 | netif_stop_queue(netdev); |
679 | 679 | ||
680 | free_irq(netdev->irq, netdev); | 680 | h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); |
681 | 681 | ||
682 | do { | 682 | do { |
683 | lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); | 683 | lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); |
@@ -689,6 +689,8 @@ static int ibmveth_close(struct net_device *netdev) | |||
689 | lpar_rc); | 689 | lpar_rc); |
690 | } | 690 | } |
691 | 691 | ||
692 | free_irq(netdev->irq, netdev); | ||
693 | |||
692 | adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); | 694 | adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); |
693 | 695 | ||
694 | ibmveth_cleanup(adapter); | 696 | ibmveth_cleanup(adapter); |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 5b3dfb4ab279..33525bf2a3d3 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1168,6 +1168,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1168 | int interrupts, nr_serviced = 0, i; | 1168 | int interrupts, nr_serviced = 0, i; |
1169 | struct ei_device *ei_local; | 1169 | struct ei_device *ei_local; |
1170 | int handled = 0; | 1170 | int handled = 0; |
1171 | unsigned long flags; | ||
1171 | 1172 | ||
1172 | e8390_base = dev->base_addr; | 1173 | e8390_base = dev->base_addr; |
1173 | ei_local = netdev_priv(dev); | 1174 | ei_local = netdev_priv(dev); |
@@ -1176,7 +1177,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1176 | * Protect the irq test too. | 1177 | * Protect the irq test too. |
1177 | */ | 1178 | */ |
1178 | 1179 | ||
1179 | spin_lock(&ei_local->page_lock); | 1180 | spin_lock_irqsave(&ei_local->page_lock, flags); |
1180 | 1181 | ||
1181 | if (ei_local->irqlock) | 1182 | if (ei_local->irqlock) |
1182 | { | 1183 | { |
@@ -1188,7 +1189,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1188 | dev->name, inb_p(e8390_base + EN0_ISR), | 1189 | dev->name, inb_p(e8390_base + EN0_ISR), |
1189 | inb_p(e8390_base + EN0_IMR)); | 1190 | inb_p(e8390_base + EN0_IMR)); |
1190 | #endif | 1191 | #endif |
1191 | spin_unlock(&ei_local->page_lock); | 1192 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1192 | return IRQ_NONE; | 1193 | return IRQ_NONE; |
1193 | } | 1194 | } |
1194 | 1195 | ||
@@ -1261,7 +1262,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1261 | ei_local->irqlock = 0; | 1262 | ei_local->irqlock = 0; |
1262 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); | 1263 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); |
1263 | 1264 | ||
1264 | spin_unlock(&ei_local->page_lock); | 1265 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1265 | return IRQ_RETVAL(handled); | 1266 | return IRQ_RETVAL(handled); |
1266 | } | 1267 | } |
1267 | 1268 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 239d7efdd450..35540411990d 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1316,7 +1316,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp, | |||
1316 | { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 }, | 1316 | { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 }, |
1317 | 1317 | ||
1318 | /* 8168C family. */ | 1318 | /* 8168C family. */ |
1319 | { 0x7cf00000, 0x3ca00000, RTL_GIGA_MAC_VER_24 }, | 1319 | { 0x7cf00000, 0x3cb00000, RTL_GIGA_MAC_VER_24 }, |
1320 | { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 }, | 1320 | { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 }, |
1321 | { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 }, | 1321 | { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 }, |
1322 | { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 }, | 1322 | { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 }, |
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index d24dc7dc0723..972a9c3af39e 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c | |||
@@ -330,6 +330,7 @@ static int prism2_pci_probe(struct pci_dev *pdev, | |||
330 | 330 | ||
331 | dev->irq = pdev->irq; | 331 | dev->irq = pdev->irq; |
332 | hw_priv->mem_start = mem; | 332 | hw_priv->mem_start = mem; |
333 | dev->base_addr = (unsigned long) mem; | ||
333 | 334 | ||
334 | prism2_pci_cor_sreset(local); | 335 | prism2_pci_cor_sreset(local); |
335 | 336 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index f59b9f7226a8..585e8166f22a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -959,6 +959,11 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
959 | BIT(NL80211_IFTYPE_WDS); | 959 | BIT(NL80211_IFTYPE_WDS); |
960 | 960 | ||
961 | /* | 961 | /* |
962 | * Initialize configuration work. | ||
963 | */ | ||
964 | INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); | ||
965 | |||
966 | /* | ||
962 | * Let the driver probe the device to detect the capabilities. | 967 | * Let the driver probe the device to detect the capabilities. |
963 | */ | 968 | */ |
964 | retval = rt2x00dev->ops->lib->probe_hw(rt2x00dev); | 969 | retval = rt2x00dev->ops->lib->probe_hw(rt2x00dev); |
@@ -968,11 +973,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
968 | } | 973 | } |
969 | 974 | ||
970 | /* | 975 | /* |
971 | * Initialize configuration work. | ||
972 | */ | ||
973 | INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); | ||
974 | |||
975 | /* | ||
976 | * Allocate queue array. | 976 | * Allocate queue array. |
977 | */ | 977 | */ |
978 | retval = rt2x00queue_allocate(rt2x00dev); | 978 | retval = rt2x00queue_allocate(rt2x00dev); |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 107af9e61dc1..7a104e2de3fa 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -177,8 +177,8 @@ static void handle_tx(struct vhost_net *net) | |||
177 | break; | 177 | break; |
178 | } | 178 | } |
179 | if (err != len) | 179 | if (err != len) |
180 | pr_err("Truncated TX packet: " | 180 | pr_debug("Truncated TX packet: " |
181 | " len %d != %zd\n", err, len); | 181 | " len %d != %zd\n", err, len); |
182 | vhost_add_used_and_signal(&net->dev, vq, head, 0); | 182 | vhost_add_used_and_signal(&net->dev, vq, head, 0); |
183 | total_len += len; | 183 | total_len += len; |
184 | if (unlikely(total_len >= VHOST_NET_WEIGHT)) { | 184 | if (unlikely(total_len >= VHOST_NET_WEIGHT)) { |
@@ -275,8 +275,8 @@ static void handle_rx(struct vhost_net *net) | |||
275 | } | 275 | } |
276 | /* TODO: Should check and handle checksum. */ | 276 | /* TODO: Should check and handle checksum. */ |
277 | if (err > len) { | 277 | if (err > len) { |
278 | pr_err("Discarded truncated rx packet: " | 278 | pr_debug("Discarded truncated rx packet: " |
279 | " len %d > %zd\n", err, len); | 279 | " len %d > %zd\n", err, len); |
280 | vhost_discard_vq_desc(vq); | 280 | vhost_discard_vq_desc(vq); |
281 | continue; | 281 | continue; |
282 | } | 282 | } |
@@ -527,17 +527,23 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
527 | 527 | ||
528 | /* start polling new socket */ | 528 | /* start polling new socket */ |
529 | oldsock = vq->private_data; | 529 | oldsock = vq->private_data; |
530 | if (sock != oldsock){ | 530 | if (sock != oldsock) { |
531 | vhost_net_disable_vq(n, vq); | 531 | vhost_net_disable_vq(n, vq); |
532 | rcu_assign_pointer(vq->private_data, sock); | 532 | rcu_assign_pointer(vq->private_data, sock); |
533 | vhost_net_enable_vq(n, vq); | 533 | vhost_net_enable_vq(n, vq); |
534 | } | 534 | } |
535 | 535 | ||
536 | done: | ||
537 | mutex_unlock(&vq->mutex); | ||
538 | |||
536 | if (oldsock) { | 539 | if (oldsock) { |
537 | vhost_net_flush_vq(n, index); | 540 | vhost_net_flush_vq(n, index); |
538 | fput(oldsock->file); | 541 | fput(oldsock->file); |
539 | } | 542 | } |
540 | 543 | ||
544 | mutex_unlock(&n->dev.mutex); | ||
545 | return 0; | ||
546 | |||
541 | err_vq: | 547 | err_vq: |
542 | mutex_unlock(&vq->mutex); | 548 | mutex_unlock(&vq->mutex); |
543 | err: | 549 | err: |
diff --git a/include/net/sock.h b/include/net/sock.h index 3100e71f0c3d..a441c9cdd625 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1226,12 +1226,7 @@ static inline void sk_tx_queue_clear(struct sock *sk) | |||
1226 | 1226 | ||
1227 | static inline int sk_tx_queue_get(const struct sock *sk) | 1227 | static inline int sk_tx_queue_get(const struct sock *sk) |
1228 | { | 1228 | { |
1229 | return sk->sk_tx_queue_mapping; | 1229 | return sk ? sk->sk_tx_queue_mapping : -1; |
1230 | } | ||
1231 | |||
1232 | static inline bool sk_tx_queue_recorded(const struct sock *sk) | ||
1233 | { | ||
1234 | return (sk && sk->sk_tx_queue_mapping >= 0); | ||
1235 | } | 1230 | } |
1236 | 1231 | ||
1237 | static inline void sk_set_socket(struct sock *sk, struct socket *sock) | 1232 | static inline void sk_set_socket(struct sock *sk, struct socket *sock) |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index b10e3cdb08f8..800b6b9fbbae 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -358,6 +358,11 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 | |||
358 | acl->sec_level = sec_level; | 358 | acl->sec_level = sec_level; |
359 | acl->auth_type = auth_type; | 359 | acl->auth_type = auth_type; |
360 | hci_acl_connect(acl); | 360 | hci_acl_connect(acl); |
361 | } else { | ||
362 | if (acl->sec_level < sec_level) | ||
363 | acl->sec_level = sec_level; | ||
364 | if (acl->auth_type < auth_type) | ||
365 | acl->auth_type = auth_type; | ||
361 | } | 366 | } |
362 | 367 | ||
363 | if (type == ACL_LINK) | 368 | if (type == ACL_LINK) |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 6c57fc71c7e2..786b5de0bac4 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1049,6 +1049,8 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s | |||
1049 | if (conn) { | 1049 | if (conn) { |
1050 | if (!ev->status) | 1050 | if (!ev->status) |
1051 | conn->link_mode |= HCI_LM_AUTH; | 1051 | conn->link_mode |= HCI_LM_AUTH; |
1052 | else | ||
1053 | conn->sec_level = BT_SECURITY_LOW; | ||
1052 | 1054 | ||
1053 | clear_bit(HCI_CONN_AUTH_PEND, &conn->pend); | 1055 | clear_bit(HCI_CONN_AUTH_PEND, &conn->pend); |
1054 | 1056 | ||
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 1b682a5aa061..cf3c4073a8a6 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -401,6 +401,11 @@ static inline void l2cap_send_rr_or_rnr(struct l2cap_pinfo *pi, u16 control) | |||
401 | l2cap_send_sframe(pi, control); | 401 | l2cap_send_sframe(pi, control); |
402 | } | 402 | } |
403 | 403 | ||
404 | static inline int __l2cap_no_conn_pending(struct sock *sk) | ||
405 | { | ||
406 | return !(l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND); | ||
407 | } | ||
408 | |||
404 | static void l2cap_do_start(struct sock *sk) | 409 | static void l2cap_do_start(struct sock *sk) |
405 | { | 410 | { |
406 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; | 411 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; |
@@ -409,12 +414,13 @@ static void l2cap_do_start(struct sock *sk) | |||
409 | if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE)) | 414 | if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE)) |
410 | return; | 415 | return; |
411 | 416 | ||
412 | if (l2cap_check_security(sk)) { | 417 | if (l2cap_check_security(sk) && __l2cap_no_conn_pending(sk)) { |
413 | struct l2cap_conn_req req; | 418 | struct l2cap_conn_req req; |
414 | req.scid = cpu_to_le16(l2cap_pi(sk)->scid); | 419 | req.scid = cpu_to_le16(l2cap_pi(sk)->scid); |
415 | req.psm = l2cap_pi(sk)->psm; | 420 | req.psm = l2cap_pi(sk)->psm; |
416 | 421 | ||
417 | l2cap_pi(sk)->ident = l2cap_get_ident(conn); | 422 | l2cap_pi(sk)->ident = l2cap_get_ident(conn); |
423 | l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND; | ||
418 | 424 | ||
419 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, | 425 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, |
420 | L2CAP_CONN_REQ, sizeof(req), &req); | 426 | L2CAP_CONN_REQ, sizeof(req), &req); |
@@ -464,12 +470,14 @@ static void l2cap_conn_start(struct l2cap_conn *conn) | |||
464 | } | 470 | } |
465 | 471 | ||
466 | if (sk->sk_state == BT_CONNECT) { | 472 | if (sk->sk_state == BT_CONNECT) { |
467 | if (l2cap_check_security(sk)) { | 473 | if (l2cap_check_security(sk) && |
474 | __l2cap_no_conn_pending(sk)) { | ||
468 | struct l2cap_conn_req req; | 475 | struct l2cap_conn_req req; |
469 | req.scid = cpu_to_le16(l2cap_pi(sk)->scid); | 476 | req.scid = cpu_to_le16(l2cap_pi(sk)->scid); |
470 | req.psm = l2cap_pi(sk)->psm; | 477 | req.psm = l2cap_pi(sk)->psm; |
471 | 478 | ||
472 | l2cap_pi(sk)->ident = l2cap_get_ident(conn); | 479 | l2cap_pi(sk)->ident = l2cap_get_ident(conn); |
480 | l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND; | ||
473 | 481 | ||
474 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, | 482 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, |
475 | L2CAP_CONN_REQ, sizeof(req), &req); | 483 | L2CAP_CONN_REQ, sizeof(req), &req); |
@@ -2912,7 +2920,6 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
2912 | l2cap_pi(sk)->ident = 0; | 2920 | l2cap_pi(sk)->ident = 0; |
2913 | l2cap_pi(sk)->dcid = dcid; | 2921 | l2cap_pi(sk)->dcid = dcid; |
2914 | l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT; | 2922 | l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT; |
2915 | |||
2916 | l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_CONNECT_PEND; | 2923 | l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_CONNECT_PEND; |
2917 | 2924 | ||
2918 | l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ, | 2925 | l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ, |
@@ -4404,6 +4411,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
4404 | req.psm = l2cap_pi(sk)->psm; | 4411 | req.psm = l2cap_pi(sk)->psm; |
4405 | 4412 | ||
4406 | l2cap_pi(sk)->ident = l2cap_get_ident(conn); | 4413 | l2cap_pi(sk)->ident = l2cap_get_ident(conn); |
4414 | l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND; | ||
4407 | 4415 | ||
4408 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, | 4416 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, |
4409 | L2CAP_CONN_REQ, sizeof(req), &req); | 4417 | L2CAP_CONN_REQ, sizeof(req), &req); |
diff --git a/net/core/dev.c b/net/core/dev.c index 9de75cdade56..6e1b4370781c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1910,8 +1910,16 @@ static int dev_gso_segment(struct sk_buff *skb) | |||
1910 | */ | 1910 | */ |
1911 | static inline void skb_orphan_try(struct sk_buff *skb) | 1911 | static inline void skb_orphan_try(struct sk_buff *skb) |
1912 | { | 1912 | { |
1913 | if (!skb_tx(skb)->flags) | 1913 | struct sock *sk = skb->sk; |
1914 | |||
1915 | if (sk && !skb_tx(skb)->flags) { | ||
1916 | /* skb_tx_hash() wont be able to get sk. | ||
1917 | * We copy sk_hash into skb->rxhash | ||
1918 | */ | ||
1919 | if (!skb->rxhash) | ||
1920 | skb->rxhash = sk->sk_hash; | ||
1914 | skb_orphan(skb); | 1921 | skb_orphan(skb); |
1922 | } | ||
1915 | } | 1923 | } |
1916 | 1924 | ||
1917 | /* | 1925 | /* |
@@ -2029,8 +2037,7 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb) | |||
2029 | if (skb->sk && skb->sk->sk_hash) | 2037 | if (skb->sk && skb->sk->sk_hash) |
2030 | hash = skb->sk->sk_hash; | 2038 | hash = skb->sk->sk_hash; |
2031 | else | 2039 | else |
2032 | hash = (__force u16) skb->protocol; | 2040 | hash = (__force u16) skb->protocol ^ skb->rxhash; |
2033 | |||
2034 | hash = jhash_1word(hash, hashrnd); | 2041 | hash = jhash_1word(hash, hashrnd); |
2035 | 2042 | ||
2036 | return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32); | 2043 | return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32); |
@@ -2053,12 +2060,11 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index) | |||
2053 | static struct netdev_queue *dev_pick_tx(struct net_device *dev, | 2060 | static struct netdev_queue *dev_pick_tx(struct net_device *dev, |
2054 | struct sk_buff *skb) | 2061 | struct sk_buff *skb) |
2055 | { | 2062 | { |
2056 | u16 queue_index; | 2063 | int queue_index; |
2057 | struct sock *sk = skb->sk; | 2064 | struct sock *sk = skb->sk; |
2058 | 2065 | ||
2059 | if (sk_tx_queue_recorded(sk)) { | 2066 | queue_index = sk_tx_queue_get(sk); |
2060 | queue_index = sk_tx_queue_get(sk); | 2067 | if (queue_index < 0) { |
2061 | } else { | ||
2062 | const struct net_device_ops *ops = dev->netdev_ops; | 2068 | const struct net_device_ops *ops = dev->netdev_ops; |
2063 | 2069 | ||
2064 | if (ops->ndo_select_queue) { | 2070 | if (ops->ndo_select_queue) { |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 6ba1c0eece03..a4e0a7482c2b 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -949,7 +949,10 @@ static void neigh_update_hhs(struct neighbour *neigh) | |||
949 | { | 949 | { |
950 | struct hh_cache *hh; | 950 | struct hh_cache *hh; |
951 | void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *) | 951 | void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *) |
952 | = neigh->dev->header_ops->cache_update; | 952 | = NULL; |
953 | |||
954 | if (neigh->dev->header_ops) | ||
955 | update = neigh->dev->header_ops->cache_update; | ||
953 | 956 | ||
954 | if (update) { | 957 | if (update) { |
955 | for (hh = neigh->hh; hh; hh = hh->hh_next) { | 958 | for (hh = neigh->hh; hh; hh = hh->hh_next) { |
diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig index c51b55400dc5..11201784d29a 100644 --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | menuconfig NET_DSA | 1 | menuconfig NET_DSA |
2 | bool "Distributed Switch Architecture support" | 2 | bool "Distributed Switch Architecture support" |
3 | default n | 3 | default n |
4 | depends on EXPERIMENTAL && !S390 | 4 | depends on EXPERIMENTAL && NET_ETHERNET && !S390 |
5 | select PHYLIB | 5 | select PHYLIB |
6 | ---help--- | 6 | ---help--- |
7 | This allows you to use hardware switch chips that use | 7 | This allows you to use hardware switch chips that use |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 539592294f45..179fcab866fc 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -442,8 +442,10 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev) | |||
442 | int err; | 442 | int err; |
443 | 443 | ||
444 | err = ipmr_fib_lookup(net, &fl, &mrt); | 444 | err = ipmr_fib_lookup(net, &fl, &mrt); |
445 | if (err < 0) | 445 | if (err < 0) { |
446 | kfree_skb(skb); | ||
446 | return err; | 447 | return err; |
448 | } | ||
447 | 449 | ||
448 | read_lock(&mrt_lock); | 450 | read_lock(&mrt_lock); |
449 | dev->stats.tx_bytes += skb->len; | 451 | dev->stats.tx_bytes += skb->len; |
@@ -1728,8 +1730,10 @@ int ip_mr_input(struct sk_buff *skb) | |||
1728 | goto dont_forward; | 1730 | goto dont_forward; |
1729 | 1731 | ||
1730 | err = ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt); | 1732 | err = ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt); |
1731 | if (err < 0) | 1733 | if (err < 0) { |
1734 | kfree_skb(skb); | ||
1732 | return err; | 1735 | return err; |
1736 | } | ||
1733 | 1737 | ||
1734 | if (!local) { | 1738 | if (!local) { |
1735 | if (IPCB(skb)->opt.router_alert) { | 1739 | if (IPCB(skb)->opt.router_alert) { |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 9fce8a8a13aa..86b9f67abede 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -608,6 +608,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, | |||
608 | ssize_t spliced; | 608 | ssize_t spliced; |
609 | int ret; | 609 | int ret; |
610 | 610 | ||
611 | sock_rps_record_flow(sk); | ||
611 | /* | 612 | /* |
612 | * We can't seek on a socket input | 613 | * We can't seek on a socket input |
613 | */ | 614 | */ |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index b3f6f099b1a3..de3bd8458588 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2210,6 +2210,9 @@ void tcp_xmit_retransmit_queue(struct sock *sk) | |||
2210 | int mib_idx; | 2210 | int mib_idx; |
2211 | int fwd_rexmitting = 0; | 2211 | int fwd_rexmitting = 0; |
2212 | 2212 | ||
2213 | if (!tp->packets_out) | ||
2214 | return; | ||
2215 | |||
2213 | if (!tp->lost_out) | 2216 | if (!tp->lost_out) |
2214 | tp->retransmit_high = tp->snd_una; | 2217 | tp->retransmit_high = tp->snd_una; |
2215 | 2218 | ||
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c index 2794b6002836..d6e9599d0705 100644 --- a/net/ipv6/mip6.c +++ b/net/ipv6/mip6.c | |||
@@ -347,11 +347,12 @@ static const struct xfrm_type mip6_destopt_type = | |||
347 | 347 | ||
348 | static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb) | 348 | static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb) |
349 | { | 349 | { |
350 | struct ipv6hdr *iph = ipv6_hdr(skb); | ||
350 | struct rt2_hdr *rt2 = (struct rt2_hdr *)skb->data; | 351 | struct rt2_hdr *rt2 = (struct rt2_hdr *)skb->data; |
351 | int err = rt2->rt_hdr.nexthdr; | 352 | int err = rt2->rt_hdr.nexthdr; |
352 | 353 | ||
353 | spin_lock(&x->lock); | 354 | spin_lock(&x->lock); |
354 | if (!ipv6_addr_equal(&rt2->addr, (struct in6_addr *)x->coaddr) && | 355 | if (!ipv6_addr_equal(&iph->daddr, (struct in6_addr *)x->coaddr) && |
355 | !ipv6_addr_any((struct in6_addr *)x->coaddr)) | 356 | !ipv6_addr_any((struct in6_addr *)x->coaddr)) |
356 | err = -ENOENT; | 357 | err = -ENOENT; |
357 | spin_unlock(&x->lock); | 358 | spin_unlock(&x->lock); |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 94d72e85a475..b2a3ae6cad78 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
@@ -698,6 +698,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp) | |||
698 | newsk = NULL; | 698 | newsk = NULL; |
699 | goto out; | 699 | goto out; |
700 | } | 700 | } |
701 | kfree_skb(oskb); | ||
701 | 702 | ||
702 | sock_hold(sk); | 703 | sock_hold(sk); |
703 | pep_sk(newsk)->listener = sk; | 704 | pep_sk(newsk)->listener = sk; |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 0be49a4b4d8c..24e614c495f2 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -205,7 +205,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
205 | { | 205 | { |
206 | struct icmphdr *icmph; | 206 | struct icmphdr *icmph; |
207 | 207 | ||
208 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) | 208 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph))) |
209 | goto drop; | 209 | goto drop; |
210 | 210 | ||
211 | icmph = (void *)(skb_network_header(skb) + ihl); | 211 | icmph = (void *)(skb_network_header(skb) + ihl); |
@@ -215,6 +215,9 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
215 | (icmph->type != ICMP_PARAMETERPROB)) | 215 | (icmph->type != ICMP_PARAMETERPROB)) |
216 | break; | 216 | break; |
217 | 217 | ||
218 | if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) | ||
219 | goto drop; | ||
220 | |||
218 | iph = (void *)(icmph + 1); | 221 | iph = (void *)(icmph + 1); |
219 | if (egress) | 222 | if (egress) |
220 | addr = iph->daddr; | 223 | addr = iph->daddr; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 037d956353e5..2b3ed7ad4933 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1594,8 +1594,8 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, | |||
1594 | 1594 | ||
1595 | /* Try to instantiate a bundle */ | 1595 | /* Try to instantiate a bundle */ |
1596 | err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); | 1596 | err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); |
1597 | if (err < 0) { | 1597 | if (err <= 0) { |
1598 | if (err != -EAGAIN) | 1598 | if (err != 0 && err != -EAGAIN) |
1599 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTPOLERROR); | 1599 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTPOLERROR); |
1600 | return ERR_PTR(err); | 1600 | return ERR_PTR(err); |
1601 | } | 1601 | } |
@@ -1678,6 +1678,13 @@ xfrm_bundle_lookup(struct net *net, struct flowi *fl, u16 family, u8 dir, | |||
1678 | goto make_dummy_bundle; | 1678 | goto make_dummy_bundle; |
1679 | dst_hold(&xdst->u.dst); | 1679 | dst_hold(&xdst->u.dst); |
1680 | return oldflo; | 1680 | return oldflo; |
1681 | } else if (new_xdst == NULL) { | ||
1682 | num_xfrms = 0; | ||
1683 | if (oldflo == NULL) | ||
1684 | goto make_dummy_bundle; | ||
1685 | xdst->num_xfrms = 0; | ||
1686 | dst_hold(&xdst->u.dst); | ||
1687 | return oldflo; | ||
1681 | } | 1688 | } |
1682 | 1689 | ||
1683 | /* Kill the previous bundle */ | 1690 | /* Kill the previous bundle */ |
@@ -1760,6 +1767,10 @@ restart: | |||
1760 | xfrm_pols_put(pols, num_pols); | 1767 | xfrm_pols_put(pols, num_pols); |
1761 | err = PTR_ERR(xdst); | 1768 | err = PTR_ERR(xdst); |
1762 | goto dropdst; | 1769 | goto dropdst; |
1770 | } else if (xdst == NULL) { | ||
1771 | num_xfrms = 0; | ||
1772 | drop_pols = num_pols; | ||
1773 | goto no_transform; | ||
1763 | } | 1774 | } |
1764 | 1775 | ||
1765 | spin_lock_bh(&xfrm_policy_sk_bundle_lock); | 1776 | spin_lock_bh(&xfrm_policy_sk_bundle_lock); |