aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/routing.c
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-02-18 05:27:34 -0500
committerAntonio Quartulli <ordex@autistici.org>2012-04-18 03:54:01 -0400
commit0d125074ebc8c971e939f8c2c8f90a80fa09aeb4 (patch)
treefb31ee069ab0a2abc7681b999839fd81392110f7 /net/batman-adv/routing.c
parent1eeb479fda2405269b3a85c86ba0eca41fcc4ea0 (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/routing.c')
-rw-r--r--net/batman-adv/routing.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index ac13a6a7409d..ff560863bc74 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -313,7 +313,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
313 goto out; 313 goto out;
314 314
315 /* create a copy of the skb, if needed, to modify it. */ 315 /* create a copy of the skb, if needed, to modify it. */
316 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) 316 if (skb_cow(skb, ETH_HLEN) < 0)
317 goto out; 317 goto out;
318 318
319 icmp_packet = (struct icmp_packet_rr *)skb->data; 319 icmp_packet = (struct icmp_packet_rr *)skb->data;
@@ -368,7 +368,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
368 goto out; 368 goto out;
369 369
370 /* create a copy of the skb, if needed, to modify it. */ 370 /* create a copy of the skb, if needed, to modify it. */
371 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) 371 if (skb_cow(skb, ETH_HLEN) < 0)
372 goto out; 372 goto out;
373 373
374 icmp_packet = (struct icmp_packet *)skb->data; 374 icmp_packet = (struct icmp_packet *)skb->data;
@@ -454,7 +454,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
454 goto out; 454 goto out;
455 455
456 /* create a copy of the skb, if needed, to modify it. */ 456 /* create a copy of the skb, if needed, to modify it. */
457 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) 457 if (skb_cow(skb, ETH_HLEN) < 0)
458 goto out; 458 goto out;
459 459
460 icmp_packet = (struct icmp_packet_rr *)skb->data; 460 icmp_packet = (struct icmp_packet_rr *)skb->data;
@@ -841,7 +841,7 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
841 goto out; 841 goto out;
842 842
843 /* create a copy of the skb, if needed, to modify it. */ 843 /* create a copy of the skb, if needed, to modify it. */
844 if (skb_cow(skb, sizeof(struct ethhdr)) < 0) 844 if (skb_cow(skb, ETH_HLEN) < 0)
845 goto out; 845 goto out;
846 846
847 unicast_packet = (struct unicast_packet *)skb->data; 847 unicast_packet = (struct unicast_packet *)skb->data;