aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/send.c
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2013-04-08 15:08:18 +0200
committerAntonio Quartulli <ordex@autistici.org>2013-05-29 02:44:54 +0200
commit7ed4be9523455a061e62236dc3caa9211cd7edda (patch)
tree476ba10f0a15e50ff9f5409f4a4f4ee0e1388a47 /net/batman-adv/send.c
parentbatman-adv: don't initialise batman_iv private members in hard-interface.c (diff)
downloadlinux-dev-7ed4be9523455a061e62236dc3caa9211cd7edda.tar.xz
linux-dev-7ed4be9523455a061e62236dc3caa9211cd7edda.zip
batman-adv: use eth_hdr() when it makes sense
Instead of casting the result of skb_mac_header() to "struct ethhdr *" every time, the eth_hdr inline function can be use to beautify the code and improve its readability. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/send.c')
-rw-r--r--net/batman-adv/send.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index eb16b04d4bee..ed7072ad84e8 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -61,7 +61,7 @@ int batadv_send_skb_packet(struct sk_buff *skb,
skb_reset_mac_header(skb);
- ethhdr = (struct ethhdr *)skb_mac_header(skb);
+ ethhdr = eth_hdr(skb);
memcpy(ethhdr->h_source, hard_iface->net_dev->dev_addr, ETH_ALEN);
memcpy(ethhdr->h_dest, dst_addr, ETH_ALEN);
ethhdr->h_proto = __constant_htons(ETH_P_BATMAN);