aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/icmp_socket.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/icmp_socket.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/icmp_socket.c')
-rw-r--r--net/batman-adv/icmp_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index b87518edcef9..2e98a57f3407 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -175,13 +175,13 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
175 if (len >= sizeof(struct icmp_packet_rr)) 175 if (len >= sizeof(struct icmp_packet_rr))
176 packet_len = sizeof(struct icmp_packet_rr); 176 packet_len = sizeof(struct icmp_packet_rr);
177 177
178 skb = dev_alloc_skb(packet_len + sizeof(struct ethhdr)); 178 skb = dev_alloc_skb(packet_len + ETH_HLEN);
179 if (!skb) { 179 if (!skb) {
180 len = -ENOMEM; 180 len = -ENOMEM;
181 goto out; 181 goto out;
182 } 182 }
183 183
184 skb_reserve(skb, sizeof(struct ethhdr)); 184 skb_reserve(skb, ETH_HLEN);
185 icmp_packet = (struct icmp_packet_rr *)skb_put(skb, packet_len); 185 icmp_packet = (struct icmp_packet_rr *)skb_put(skb, packet_len);
186 186
187 if (copy_from_user(icmp_packet, buff, packet_len)) { 187 if (copy_from_user(icmp_packet, buff, packet_len)) {