]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/if_arp.h
[ARP]: Introduce the arp_hdr_len helper.
[net-next-2.6.git] / include / linux / if_arp.h
index 296e8e86e91d1c33052ea2b27ad3b1d8f86895db..4d3401812e6cbfe237902c51a00e7123a96fc4cb 100644 (file)
@@ -156,6 +156,12 @@ static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
 {
        return (struct arphdr *)skb_network_header(skb);
 }
+
+static inline int arp_hdr_len(struct net_device *dev)
+{
+       /* ARP header, plus 2 device addresses, plus 2 IP addresses. */
+       return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2;
+}
 #endif
 
 #endif /* _LINUX_IF_ARP_H */