Skip to content

Commit a16aeb3

Browse files
acmelDavid S. Miller
authored andcommitted
[BONDING]: Introduce arp_pkt()
For consistency with all the other skb->nh.raw accessors. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 797659f commit a16aeb3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎drivers/net/bonding/bond_alb.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ struct arp_pkt {
104104
};
105105
#pragma pack()
106106

107+
static inline struct arp_pkt *arp_pkt(const struct sk_buff *skb)
108+
{
109+
return (struct arp_pkt *)skb->nh.raw;
110+
}
111+
107112
/* Forward declaration */
108113
static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);
109114

@@ -613,7 +618,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, u32 src_ip)
613618
static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bond)
614619
{
615620
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
616-
struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw;
621+
struct arp_pkt *arp = arp_pkt(skb);
617622
struct slave *assigned_slave;
618623
struct rlb_client_info *client_info;
619624
u32 hash_index = 0;
@@ -701,7 +706,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
701706
*/
702707
static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
703708
{
704-
struct arp_pkt *arp = (struct arp_pkt *)skb->nh.raw;
709+
struct arp_pkt *arp = arp_pkt(skb);
705710
struct slave *tx_slave = NULL;
706711

707712
if (arp->op_code == __constant_htons(ARPOP_REPLY)) {

0 commit comments

Comments
 (0)