- patches.apparmor/remove_suid_new_case_in_2.6.22.diff: Merge fix.
[linux-flexiantxendom0-3.2.10.git] / drivers / net / bonding / bond_main.c
index 86a2bd8..7756711 100644 (file)
@@ -1361,13 +1361,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
                goto err_undo_flags;
        }
 
-       if (slave_dev->get_stats == NULL) {
-               printk(KERN_NOTICE DRV_NAME
-                       ": %s: the driver for slave device %s does not provide "
-                       "get_stats function, network statistics will be "
-                       "inaccurate.\n", bond_dev->name, slave_dev->name);
-       }
-
        new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
        if (!new_slave) {
                res = -ENOMEM;
@@ -2526,7 +2519,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
                                 (2 * sizeof(u32)))))
                goto out_unlock;
 
-       arp = skb->nh.arph;
+       arp = arp_hdr(skb);
        if (arp->ar_hln != dev->addr_len ||
            skb->pkt_type == PACKET_OTHERHOST ||
            skb->pkt_type == PACKET_LOOPBACK ||
@@ -3472,7 +3465,7 @@ void bond_unregister_arp(struct bonding *bond)
 /*---------------------------- Hashing Policies -----------------------------*/
 
 /*
- * Hash for the the output device based upon layer 3 and layer 4 data. If
+ * Hash for the output device based upon layer 3 and layer 4 data. If
  * the packet is a frag or not TCP or UDP, just use layer 3 data.  If it is
  * altogether not IP, mimic bond_xmit_hash_policy_l2()
  */
@@ -3480,7 +3473,7 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb,
                                    struct net_device *bond_dev, int count)
 {
        struct ethhdr *data = (struct ethhdr *)skb->data;
-       struct iphdr *iph = skb->nh.iph;
+       struct iphdr *iph = ip_hdr(skb);
        u16 *layer4hdr = (u16 *)((u32 *)iph + iph->ihl);
        int layer4_xor = 0;
 
@@ -3623,35 +3616,32 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
        read_lock_bh(&bond->lock);
 
        bond_for_each_slave(bond, slave, i) {
-               if (slave->dev->get_stats) {
-                       sstats = slave->dev->get_stats(slave->dev);
-
-                       stats->rx_packets += sstats->rx_packets;
-                       stats->rx_bytes += sstats->rx_bytes;
-                       stats->rx_errors += sstats->rx_errors;
-                       stats->rx_dropped += sstats->rx_dropped;
-
-                       stats->tx_packets += sstats->tx_packets;
-                       stats->tx_bytes += sstats->tx_bytes;
-                       stats->tx_errors += sstats->tx_errors;
-                       stats->tx_dropped += sstats->tx_dropped;
-
-                       stats->multicast += sstats->multicast;
-                       stats->collisions += sstats->collisions;
-
-                       stats->rx_length_errors += sstats->rx_length_errors;
-                       stats->rx_over_errors += sstats->rx_over_errors;
-                       stats->rx_crc_errors += sstats->rx_crc_errors;
-                       stats->rx_frame_errors += sstats->rx_frame_errors;
-                       stats->rx_fifo_errors += sstats->rx_fifo_errors;
-                       stats->rx_missed_errors += sstats->rx_missed_errors;
-
-                       stats->tx_aborted_errors += sstats->tx_aborted_errors;
-                       stats->tx_carrier_errors += sstats->tx_carrier_errors;
-                       stats->tx_fifo_errors += sstats->tx_fifo_errors;
-                       stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
-                       stats->tx_window_errors += sstats->tx_window_errors;
-               }
+               sstats = slave->dev->get_stats(slave->dev);
+               stats->rx_packets += sstats->rx_packets;
+               stats->rx_bytes += sstats->rx_bytes;
+               stats->rx_errors += sstats->rx_errors;
+               stats->rx_dropped += sstats->rx_dropped;
+
+               stats->tx_packets += sstats->tx_packets;
+               stats->tx_bytes += sstats->tx_bytes;
+               stats->tx_errors += sstats->tx_errors;
+               stats->tx_dropped += sstats->tx_dropped;
+
+               stats->multicast += sstats->multicast;
+               stats->collisions += sstats->collisions;
+
+               stats->rx_length_errors += sstats->rx_length_errors;
+               stats->rx_over_errors += sstats->rx_over_errors;
+               stats->rx_crc_errors += sstats->rx_crc_errors;
+               stats->rx_frame_errors += sstats->rx_frame_errors;
+               stats->rx_fifo_errors += sstats->rx_fifo_errors;
+               stats->rx_missed_errors += sstats->rx_missed_errors;
+
+               stats->tx_aborted_errors += sstats->tx_aborted_errors;
+               stats->tx_carrier_errors += sstats->tx_carrier_errors;
+               stats->tx_fifo_errors += sstats->tx_fifo_errors;
+               stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
+               stats->tx_window_errors += sstats->tx_window_errors;
        }
 
        read_unlock_bh(&bond->lock);