diff options
Diffstat (limited to 'net/batman-adv/icmp_socket.c')
-rw-r--r-- | net/batman-adv/icmp_socket.c | 4 |
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)) { |