aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/bonding/bond_3ad.c6
-rw-r--r--drivers/net/bonding/bond_3ad.h1
-rw-r--r--drivers/net/irda/irtty-sir.c1
-rw-r--r--drivers/net/usb/ax88179_178a.c4
-rw-r--r--drivers/net/usb/gl620a.c4
-rw-r--r--drivers/net/usb/mcs7830.c5
-rw-r--r--drivers/net/usb/net1080.c4
-rw-r--r--drivers/net/usb/qmi_wwan.c8
-rw-r--r--drivers/net/usb/rndis_host.c4
-rw-r--r--drivers/net/usb/smsc75xx.c4
-rw-r--r--drivers/net/usb/smsc95xx.c4
-rw-r--r--drivers/net/usb/sr9800.c4
-rw-r--r--drivers/net/usb/usbnet.c25
-rw-r--r--net/ipv4/route.c4
-rw-r--r--net/ipv6/addrconf.c2
15 files changed, 52 insertions, 28 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index cce1f1bf90b4..6d20fbde8d43 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1796,8 +1796,6 @@ void bond_3ad_initiate_agg_selection(struct bonding *bond, int timeout)
1796 BOND_AD_INFO(bond).agg_select_timer = timeout; 1796 BOND_AD_INFO(bond).agg_select_timer = timeout;
1797} 1797}
1798 1798
1799static u16 aggregator_identifier;
1800
1801/** 1799/**
1802 * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures 1800 * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures
1803 * @bond: bonding struct to work on 1801 * @bond: bonding struct to work on
@@ -1811,7 +1809,7 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
1811 if (!MAC_ADDRESS_EQUAL(&(BOND_AD_INFO(bond).system.sys_mac_addr), 1809 if (!MAC_ADDRESS_EQUAL(&(BOND_AD_INFO(bond).system.sys_mac_addr),
1812 bond->dev->dev_addr)) { 1810 bond->dev->dev_addr)) {
1813 1811
1814 aggregator_identifier = 0; 1812 BOND_AD_INFO(bond).aggregator_identifier = 0;
1815 1813
1816 BOND_AD_INFO(bond).system.sys_priority = 0xFFFF; 1814 BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
1817 BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr); 1815 BOND_AD_INFO(bond).system.sys_mac_addr = *((struct mac_addr *)bond->dev->dev_addr);
@@ -1880,7 +1878,7 @@ void bond_3ad_bind_slave(struct slave *slave)
1880 ad_initialize_agg(aggregator); 1878 ad_initialize_agg(aggregator);
1881 1879
1882 aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr); 1880 aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
1883 aggregator->aggregator_identifier = (++aggregator_identifier); 1881 aggregator->aggregator_identifier = ++BOND_AD_INFO(bond).aggregator_identifier;
1884 aggregator->slave = slave; 1882 aggregator->slave = slave;
1885 aggregator->is_active = 0; 1883 aggregator->is_active = 0;
1886 aggregator->num_of_ports = 0; 1884 aggregator->num_of_ports = 0;
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h
index 13dc9d3c5e34..f4dd9592ac62 100644
--- a/drivers/net/bonding/bond_3ad.h
+++ b/drivers/net/bonding/bond_3ad.h
@@ -253,6 +253,7 @@ struct ad_system {
253struct ad_bond_info { 253struct ad_bond_info {
254 struct ad_system system; /* 802.3ad system structure */ 254 struct ad_system system; /* 802.3ad system structure */
255 u32 agg_select_timer; // Timer to select aggregator after all adapter's hand shakes 255 u32 agg_select_timer; // Timer to select aggregator after all adapter's hand shakes
256 u16 aggregator_identifier;
256}; 257};
257 258
258struct ad_slave_info { 259struct ad_slave_info {
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index 177441afeb96..24b6dddd7f2f 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -522,7 +522,6 @@ static void irtty_close(struct tty_struct *tty)
522 sirdev_put_instance(priv->dev); 522 sirdev_put_instance(priv->dev);
523 523
524 /* Stop tty */ 524 /* Stop tty */
525 irtty_stop_receiver(tty, TRUE);
526 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); 525 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
527 if (tty->ops->stop) 526 if (tty->ops->stop)
528 tty->ops->stop(tty); 527 tty->ops->stop(tty);
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index d6f64dad05bc..955df81a4358 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1118,6 +1118,10 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
1118 u16 hdr_off; 1118 u16 hdr_off;
1119 u32 *pkt_hdr; 1119 u32 *pkt_hdr;
1120 1120
1121 /* This check is no longer done by usbnet */
1122 if (skb->len < dev->net->hard_header_len)
1123 return 0;
1124
1121 skb_trim(skb, skb->len - 4); 1125 skb_trim(skb, skb->len - 4);
1122 memcpy(&rx_hdr, skb_tail_pointer(skb), 4); 1126 memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
1123 le32_to_cpus(&rx_hdr); 1127 le32_to_cpus(&rx_hdr);
diff --git a/drivers/net/usb/gl620a.c b/drivers/net/usb/gl620a.c
index e4a8a93fbaf7..1cc24e6f23e2 100644
--- a/drivers/net/usb/gl620a.c
+++ b/drivers/net/usb/gl620a.c
@@ -84,6 +84,10 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
84 u32 size; 84 u32 size;
85 u32 count; 85 u32 count;
86 86
87 /* This check is no longer done by usbnet */
88 if (skb->len < dev->net->hard_header_len)
89 return 0;
90
87 header = (struct gl_header *) skb->data; 91 header = (struct gl_header *) skb->data;
88 92
89 // get the packet count of the received skb 93 // get the packet count of the received skb
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index a305a7b2dae6..82d844a8ebd0 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -526,8 +526,9 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
526{ 526{
527 u8 status; 527 u8 status;
528 528
529 if (skb->len == 0) { 529 /* This check is no longer done by usbnet */
530 dev_err(&dev->udev->dev, "unexpected empty rx frame\n"); 530 if (skb->len < dev->net->hard_header_len) {
531 dev_err(&dev->udev->dev, "unexpected tiny rx frame\n");
531 return 0; 532 return 0;
532 } 533 }
533 534
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
index 0a85d9227775..4cbdb1307f3e 100644
--- a/drivers/net/usb/net1080.c
+++ b/drivers/net/usb/net1080.c
@@ -364,6 +364,10 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
364 struct nc_trailer *trailer; 364 struct nc_trailer *trailer;
365 u16 hdr_len, packet_len; 365 u16 hdr_len, packet_len;
366 366
367 /* This check is no longer done by usbnet */
368 if (skb->len < dev->net->hard_header_len)
369 return 0;
370
367 if (!(skb->len & 0x01)) { 371 if (!(skb->len & 0x01)) {
368 netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n", 372 netdev_dbg(dev->net, "rx framesize %d range %d..%d mtu %d\n",
369 skb->len, dev->net->hard_header_len, dev->hard_mtu, 373 skb->len, dev->net->hard_header_len, dev->hard_mtu,
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 1eddd43b2f32..313cb6cd4848 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -80,10 +80,10 @@ static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
80{ 80{
81 __be16 proto; 81 __be16 proto;
82 82
83 /* usbnet rx_complete guarantees that skb->len is at least 83 /* This check is no longer done by usbnet */
84 * hard_header_len, so we can inspect the dest address without 84 if (skb->len < dev->net->hard_header_len)
85 * checking skb->len 85 return 0;
86 */ 86
87 switch (skb->data[0] & 0xf0) { 87 switch (skb->data[0] & 0xf0) {
88 case 0x40: 88 case 0x40:
89 proto = htons(ETH_P_IP); 89 proto = htons(ETH_P_IP);
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index a48bc0f20c1a..524a47a28120 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -492,6 +492,10 @@ EXPORT_SYMBOL_GPL(rndis_unbind);
492 */ 492 */
493int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) 493int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
494{ 494{
495 /* This check is no longer done by usbnet */
496 if (skb->len < dev->net->hard_header_len)
497 return 0;
498
495 /* peripheral may have batched packets to us... */ 499 /* peripheral may have batched packets to us... */
496 while (likely(skb->len)) { 500 while (likely(skb->len)) {
497 struct rndis_data_hdr *hdr = (void *)skb->data; 501 struct rndis_data_hdr *hdr = (void *)skb->data;
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index f17b9e02dd34..d9e7892262fa 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -2106,6 +2106,10 @@ static void smsc75xx_rx_csum_offload(struct usbnet *dev, struct sk_buff *skb,
2106 2106
2107static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) 2107static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
2108{ 2108{
2109 /* This check is no longer done by usbnet */
2110 if (skb->len < dev->net->hard_header_len)
2111 return 0;
2112
2109 while (skb->len > 0) { 2113 while (skb->len > 0) {
2110 u32 rx_cmd_a, rx_cmd_b, align_count, size; 2114 u32 rx_cmd_a, rx_cmd_b, align_count, size;
2111 struct sk_buff *ax_skb; 2115 struct sk_buff *ax_skb;
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 8dd54a0f7b29..424db65e4396 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1723,6 +1723,10 @@ static void smsc95xx_rx_csum_offload(struct sk_buff *skb)
1723 1723
1724static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) 1724static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
1725{ 1725{
1726 /* This check is no longer done by usbnet */
1727 if (skb->len < dev->net->hard_header_len)
1728 return 0;
1729
1726 while (skb->len > 0) { 1730 while (skb->len > 0) {
1727 u32 header, align_count; 1731 u32 header, align_count;
1728 struct sk_buff *ax_skb; 1732 struct sk_buff *ax_skb;
diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c
index 801710883727..b94a0fbb8b3b 100644
--- a/drivers/net/usb/sr9800.c
+++ b/drivers/net/usb/sr9800.c
@@ -63,6 +63,10 @@ static int sr_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
63{ 63{
64 int offset = 0; 64 int offset = 0;
65 65
66 /* This check is no longer done by usbnet */
67 if (skb->len < dev->net->hard_header_len)
68 return 0;
69
66 while (offset + sizeof(u32) < skb->len) { 70 while (offset + sizeof(u32) < skb->len) {
67 struct sk_buff *sr_skb; 71 struct sk_buff *sr_skb;
68 u16 size; 72 u16 size;
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 4671da755e7b..dd10d5817d2a 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -542,17 +542,19 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
542 } 542 }
543 // else network stack removes extra byte if we forced a short packet 543 // else network stack removes extra byte if we forced a short packet
544 544
545 if (skb->len) { 545 /* all data was already cloned from skb inside the driver */
546 /* all data was already cloned from skb inside the driver */ 546 if (dev->driver_info->flags & FLAG_MULTI_PACKET)
547 if (dev->driver_info->flags & FLAG_MULTI_PACKET) 547 goto done;
548 dev_kfree_skb_any(skb); 548
549 else 549 if (skb->len < ETH_HLEN) {
550 usbnet_skb_return(dev, skb); 550 dev->net->stats.rx_errors++;
551 dev->net->stats.rx_length_errors++;
552 netif_dbg(dev, rx_err, dev->net, "rx length %d\n", skb->len);
553 } else {
554 usbnet_skb_return(dev, skb);
551 return; 555 return;
552 } 556 }
553 557
554 netif_dbg(dev, rx_err, dev->net, "drop\n");
555 dev->net->stats.rx_errors++;
556done: 558done:
557 skb_queue_tail(&dev->done, skb); 559 skb_queue_tail(&dev->done, skb);
558} 560}
@@ -574,13 +576,6 @@ static void rx_complete (struct urb *urb)
574 switch (urb_status) { 576 switch (urb_status) {
575 /* success */ 577 /* success */
576 case 0: 578 case 0:
577 if (skb->len < dev->net->hard_header_len) {
578 state = rx_cleanup;
579 dev->net->stats.rx_errors++;
580 dev->net->stats.rx_length_errors++;
581 netif_dbg(dev, rx_err, dev->net,
582 "rx length %d\n", skb->len);
583 }
584 break; 579 break;
585 580
586 /* stalls need manual reset. this is rare ... except that 581 /* stalls need manual reset. this is rare ... except that
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6f6dd85bdffc..4c011ec69ed4 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1597,6 +1597,7 @@ static int __mkroute_input(struct sk_buff *skb,
1597 rth->rt_gateway = 0; 1597 rth->rt_gateway = 0;
1598 rth->rt_uses_gateway = 0; 1598 rth->rt_uses_gateway = 0;
1599 INIT_LIST_HEAD(&rth->rt_uncached); 1599 INIT_LIST_HEAD(&rth->rt_uncached);
1600 RT_CACHE_STAT_INC(in_slow_tot);
1600 1601
1601 rth->dst.input = ip_forward; 1602 rth->dst.input = ip_forward;
1602 rth->dst.output = ip_output; 1603 rth->dst.output = ip_output;
@@ -1701,8 +1702,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
1701 goto no_route; 1702 goto no_route;
1702 } 1703 }
1703 1704
1704 RT_CACHE_STAT_INC(in_slow_tot);
1705
1706 if (res.type == RTN_BROADCAST) 1705 if (res.type == RTN_BROADCAST)
1707 goto brd_input; 1706 goto brd_input;
1708 1707
@@ -1773,6 +1772,7 @@ local_input:
1773 rth->rt_gateway = 0; 1772 rth->rt_gateway = 0;
1774 rth->rt_uses_gateway = 0; 1773 rth->rt_uses_gateway = 0;
1775 INIT_LIST_HEAD(&rth->rt_uncached); 1774 INIT_LIST_HEAD(&rth->rt_uncached);
1775 RT_CACHE_STAT_INC(in_slow_tot);
1776 if (res.type == RTN_UNREACHABLE) { 1776 if (res.type == RTN_UNREACHABLE) {
1777 rth->dst.input= ip_error; 1777 rth->dst.input= ip_error;
1778 rth->dst.error= -err; 1778 rth->dst.error= -err;
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index ad235690684c..fdbfeca36d63 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2783,6 +2783,8 @@ static void addrconf_gre_config(struct net_device *dev)
2783 ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); 2783 ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0);
2784 if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) 2784 if (!ipv6_generate_eui64(addr.s6_addr + 8, dev))
2785 addrconf_add_linklocal(idev, &addr); 2785 addrconf_add_linklocal(idev, &addr);
2786 else
2787 addrconf_prefix_route(&addr, 64, dev, 0, 0);
2786} 2788}
2787#endif 2789#endif
2788 2790