summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_iv_ogm.c
diff options
context:
space:
mode:
authorAntonio Quartulli2012-02-18 11:27:34 +0100
committerAntonio Quartulli2012-04-18 09:54:01 +0200
commit0d125074ebc8c971e939f8c2c8f90a80fa09aeb4 (patch)
treefb31ee069ab0a2abc7681b999839fd81392110f7 /net/batman-adv/bat_iv_ogm.c
parentbatman-adv: mark existing ogm variables as batman iv (diff)
downloadkernel-qcow2-linux-0d125074ebc8c971e939f8c2c8f90a80fa09aeb4.tar.gz
kernel-qcow2-linux-0d125074ebc8c971e939f8c2c8f90a80fa09aeb4.tar.xz
kernel-qcow2-linux-0d125074ebc8c971e939f8c2c8f90a80fa09aeb4.zip
batman-adv: use ETH_HLEN instead of sizeof(struct ethhdr)
Instead of using sizeof(struct ethhdr) it is strongly recommended to use the kernel macro ETH_HLEN. This patch substitute each occurrence of the former expressione with the latter one. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r--net/batman-adv/bat_iv_ogm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 98f71827c7b3..d7fa8afd7ff8 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -355,10 +355,9 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,
if ((atomic_read(&bat_priv->aggregated_ogms)) &&
(packet_len < MAX_AGGREGATION_BYTES))
forw_packet_aggr->skb = dev_alloc_skb(MAX_AGGREGATION_BYTES +
- sizeof(struct ethhdr));
+ ETH_HLEN);
else
- forw_packet_aggr->skb = dev_alloc_skb(packet_len +
- sizeof(struct ethhdr));
+ forw_packet_aggr->skb = dev_alloc_skb(packet_len + ETH_HLEN);
if (!forw_packet_aggr->skb) {
if (!own_packet)
@@ -366,7 +365,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,
kfree(forw_packet_aggr);
goto out;
}
- skb_reserve(forw_packet_aggr->skb, sizeof(struct ethhdr));
+ skb_reserve(forw_packet_aggr->skb, ETH_HLEN);
INIT_HLIST_NODE(&forw_packet_aggr->list);