diff options
Diffstat (limited to 'net/batman-adv/icmp_socket.c')
-rw-r--r-- | net/batman-adv/icmp_socket.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index 5a99bb4b6b82..82ac6472fa6f 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c | |||
@@ -192,25 +192,25 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
192 | goto free_skb; | 192 | goto free_skb; |
193 | } | 193 | } |
194 | 194 | ||
195 | if (icmp_packet->header.packet_type != BATADV_ICMP) { | 195 | if (icmp_packet->icmph.header.packet_type != BATADV_ICMP) { |
196 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, | 196 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, |
197 | "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n"); | 197 | "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n"); |
198 | len = -EINVAL; | 198 | len = -EINVAL; |
199 | goto free_skb; | 199 | goto free_skb; |
200 | } | 200 | } |
201 | 201 | ||
202 | if (icmp_packet->msg_type != BATADV_ECHO_REQUEST) { | 202 | if (icmp_packet->icmph.msg_type != BATADV_ECHO_REQUEST) { |
203 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, | 203 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, |
204 | "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n"); | 204 | "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n"); |
205 | len = -EINVAL; | 205 | len = -EINVAL; |
206 | goto free_skb; | 206 | goto free_skb; |
207 | } | 207 | } |
208 | 208 | ||
209 | icmp_packet->uid = socket_client->index; | 209 | icmp_packet->icmph.uid = socket_client->index; |
210 | 210 | ||
211 | if (icmp_packet->header.version != BATADV_COMPAT_VERSION) { | 211 | if (icmp_packet->icmph.header.version != BATADV_COMPAT_VERSION) { |
212 | icmp_packet->msg_type = BATADV_PARAMETER_PROBLEM; | 212 | icmp_packet->icmph.msg_type = BATADV_PARAMETER_PROBLEM; |
213 | icmp_packet->header.version = BATADV_COMPAT_VERSION; | 213 | icmp_packet->icmph.header.version = BATADV_COMPAT_VERSION; |
214 | batadv_socket_add_packet(socket_client, icmp_packet, | 214 | batadv_socket_add_packet(socket_client, icmp_packet, |
215 | packet_len); | 215 | packet_len); |
216 | goto free_skb; | 216 | goto free_skb; |
@@ -219,7 +219,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
219 | if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) | 219 | if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE) |
220 | goto dst_unreach; | 220 | goto dst_unreach; |
221 | 221 | ||
222 | orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->dst); | 222 | orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->icmph.dst); |
223 | if (!orig_node) | 223 | if (!orig_node) |
224 | goto dst_unreach; | 224 | goto dst_unreach; |
225 | 225 | ||
@@ -233,7 +233,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
233 | if (neigh_node->if_incoming->if_status != BATADV_IF_ACTIVE) | 233 | if (neigh_node->if_incoming->if_status != BATADV_IF_ACTIVE) |
234 | goto dst_unreach; | 234 | goto dst_unreach; |
235 | 235 | ||
236 | memcpy(icmp_packet->orig, | 236 | memcpy(icmp_packet->icmph.orig, |
237 | primary_if->net_dev->dev_addr, ETH_ALEN); | 237 | primary_if->net_dev->dev_addr, ETH_ALEN); |
238 | 238 | ||
239 | if (packet_len == sizeof(struct batadv_icmp_packet_rr)) | 239 | if (packet_len == sizeof(struct batadv_icmp_packet_rr)) |
@@ -244,7 +244,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
244 | goto out; | 244 | goto out; |
245 | 245 | ||
246 | dst_unreach: | 246 | dst_unreach: |
247 | icmp_packet->msg_type = BATADV_DESTINATION_UNREACHABLE; | 247 | icmp_packet->icmph.msg_type = BATADV_DESTINATION_UNREACHABLE; |
248 | batadv_socket_add_packet(socket_client, icmp_packet, packet_len); | 248 | batadv_socket_add_packet(socket_client, icmp_packet, packet_len); |
249 | free_skb: | 249 | free_skb: |
250 | kfree_skb(skb); | 250 | kfree_skb(skb); |
@@ -318,7 +318,7 @@ static void batadv_socket_add_packet(struct batadv_socket_client *socket_client, | |||
318 | /* while waiting for the lock the socket_client could have been | 318 | /* while waiting for the lock the socket_client could have been |
319 | * deleted | 319 | * deleted |
320 | */ | 320 | */ |
321 | if (!batadv_socket_client_hash[icmp_packet->uid]) { | 321 | if (!batadv_socket_client_hash[icmp_packet->icmph.uid]) { |
322 | spin_unlock_bh(&socket_client->lock); | 322 | spin_unlock_bh(&socket_client->lock); |
323 | kfree(socket_packet); | 323 | kfree(socket_packet); |
324 | return; | 324 | return; |
@@ -347,7 +347,7 @@ void batadv_socket_receive_packet(struct batadv_icmp_packet_rr *icmp_packet, | |||
347 | { | 347 | { |
348 | struct batadv_socket_client *hash; | 348 | struct batadv_socket_client *hash; |
349 | 349 | ||
350 | hash = batadv_socket_client_hash[icmp_packet->uid]; | 350 | hash = batadv_socket_client_hash[icmp_packet->icmph.uid]; |
351 | if (hash) | 351 | if (hash) |
352 | batadv_socket_add_packet(hash, icmp_packet, icmp_len); | 352 | batadv_socket_add_packet(hash, icmp_packet, icmp_len); |
353 | } | 353 | } |