Commit a16aeb36 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[BONDING]: Introduce arp_pkt()

For consistency with all the other skb->nh.raw accessors.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 797659fb
...@@ -104,6 +104,11 @@ struct arp_pkt { ...@@ -104,6 +104,11 @@ struct arp_pkt {
}; };
#pragma pack() #pragma pack()
static inline struct arp_pkt *arp_pkt(const struct sk_buff *skb)
{
return (struct arp_pkt *)skb->nh.raw;
}
/* Forward declaration */ /* Forward declaration */
static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]); static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);
...@@ -613,7 +618,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip) ...@@ -613,7 +618,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip)
static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bond) static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bond)
{ {
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw; struct arp_pkt *arp = arp_pkt(skb);
struct slave *assigned_slave; struct slave *assigned_slave;
struct rlb_client_info *client_info; struct rlb_client_info *client_info;
u32 hash_index = 0; u32 hash_index = 0;
...@@ -701,7 +706,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon ...@@ -701,7 +706,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
*/ */
static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
{ {
struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw; struct arp_pkt *arp = arp_pkt(skb);
struct slave *tx_slave = NULL; struct slave *tx_slave = NULL;
if (arp->op_code == __constant_htons(ARPOP_REPLY)) { if (arp->op_code == __constant_htons(ARPOP_REPLY)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment