bonding: move processing of recv handlers into handle_frame()
[linux-flexiantxendom0-3.2.10.git] / drivers / net / bonding / bond_3ad.c
index 123dd60..d0981c2 100644 (file)
@@ -2465,35 +2465,16 @@ out:
        return NETDEV_TX_OK;
 }
 
-int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev)
+void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
+                         struct slave *slave)
 {
-       struct bonding *bond = netdev_priv(dev);
-       struct slave *slave = NULL;
-       int ret = NET_RX_DROP;
-
-       if (!(dev->flags & IFF_MASTER))
-               goto out;
-
-       skb = skb_share_check(skb, GFP_ATOMIC);
-       if (!skb)
-               goto out;
+       if (skb->protocol != PKT_TYPE_LACPDU)
+               return;
 
        if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
-               goto out;
+               return;
 
        read_lock(&bond->lock);
-       slave = bond_get_slave_by_dev(netdev_priv(dev), orig_dev);
-       if (!slave)
-               goto out_unlock;
-
        bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
-
-       ret = NET_RX_SUCCESS;
-
-out_unlock:
        read_unlock(&bond->lock);
-out:
-       dev_kfree_skb(skb);
-
-       return ret;
 }