diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-02-18 05:27:34 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-04-18 03:54:01 -0400 |
commit | 0d125074ebc8c971e939f8c2c8f90a80fa09aeb4 (patch) | |
tree | fb31ee069ab0a2abc7681b999839fd81392110f7 /net/batman-adv/bat_iv_ogm.c | |
parent | 1eeb479fda2405269b3a85c86ba0eca41fcc4ea0 (diff) |
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.c | 7 |
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, | |||
355 | if ((atomic_read(&bat_priv->aggregated_ogms)) && | 355 | if ((atomic_read(&bat_priv->aggregated_ogms)) && |
356 | (packet_len < MAX_AGGREGATION_BYTES)) | 356 | (packet_len < MAX_AGGREGATION_BYTES)) |
357 | forw_packet_aggr->skb = dev_alloc_skb(MAX_AGGREGATION_BYTES + | 357 | forw_packet_aggr->skb = dev_alloc_skb(MAX_AGGREGATION_BYTES + |
358 | sizeof(struct ethhdr)); | 358 | ETH_HLEN); |
359 | else | 359 | else |
360 | forw_packet_aggr->skb = dev_alloc_skb(packet_len + | 360 | forw_packet_aggr->skb = dev_alloc_skb(packet_len + ETH_HLEN); |
361 | sizeof(struct ethhdr)); | ||
362 | 361 | ||
363 | if (!forw_packet_aggr->skb) { | 362 | if (!forw_packet_aggr->skb) { |
364 | if (!own_packet) | 363 | if (!own_packet) |
@@ -366,7 +365,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff, | |||
366 | kfree(forw_packet_aggr); | 365 | kfree(forw_packet_aggr); |
367 | goto out; | 366 | goto out; |
368 | } | 367 | } |
369 | skb_reserve(forw_packet_aggr->skb, sizeof(struct ethhdr)); | 368 | skb_reserve(forw_packet_aggr->skb, ETH_HLEN); |
370 | 369 | ||
371 | INIT_HLIST_NODE(&forw_packet_aggr->list); | 370 | INIT_HLIST_NODE(&forw_packet_aggr->list); |
372 | 371 | ||