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 61b52b379564..ca07580c1b44 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c | |||
@@ -29,7 +29,7 @@ | |||
29 | static struct socket_client *batadv_socket_client_hash[256]; | 29 | static struct socket_client *batadv_socket_client_hash[256]; |
30 | 30 | ||
31 | static void batadv_socket_add_packet(struct socket_client *socket_client, | 31 | static void batadv_socket_add_packet(struct socket_client *socket_client, |
32 | struct icmp_packet_rr *icmp_packet, | 32 | struct batadv_icmp_packet_rr *icmp_packet, |
33 | size_t icmp_len); | 33 | size_t icmp_len); |
34 | 34 | ||
35 | void batadv_socket_init(void) | 35 | void batadv_socket_init(void) |
@@ -112,7 +112,7 @@ static ssize_t batadv_socket_read(struct file *file, char __user *buf, | |||
112 | if ((file->f_flags & O_NONBLOCK) && (socket_client->queue_len == 0)) | 112 | if ((file->f_flags & O_NONBLOCK) && (socket_client->queue_len == 0)) |
113 | return -EAGAIN; | 113 | return -EAGAIN; |
114 | 114 | ||
115 | if ((!buf) || (count < sizeof(struct icmp_packet))) | 115 | if ((!buf) || (count < sizeof(struct batadv_icmp_packet))) |
116 | return -EINVAL; | 116 | return -EINVAL; |
117 | 117 | ||
118 | if (!access_ok(VERIFY_WRITE, buf, count)) | 118 | if (!access_ok(VERIFY_WRITE, buf, count)) |
@@ -151,13 +151,13 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
151 | struct bat_priv *bat_priv = socket_client->bat_priv; | 151 | struct bat_priv *bat_priv = socket_client->bat_priv; |
152 | struct hard_iface *primary_if = NULL; | 152 | struct hard_iface *primary_if = NULL; |
153 | struct sk_buff *skb; | 153 | struct sk_buff *skb; |
154 | struct icmp_packet_rr *icmp_packet; | 154 | struct batadv_icmp_packet_rr *icmp_packet; |
155 | 155 | ||
156 | struct orig_node *orig_node = NULL; | 156 | struct orig_node *orig_node = NULL; |
157 | struct neigh_node *neigh_node = NULL; | 157 | struct neigh_node *neigh_node = NULL; |
158 | size_t packet_len = sizeof(struct icmp_packet); | 158 | size_t packet_len = sizeof(struct batadv_icmp_packet); |
159 | 159 | ||
160 | if (len < sizeof(struct icmp_packet)) { | 160 | if (len < sizeof(struct batadv_icmp_packet)) { |
161 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, | 161 | batadv_dbg(BATADV_DBG_BATMAN, bat_priv, |
162 | "Error - can't send packet from char device: invalid packet size\n"); | 162 | "Error - can't send packet from char device: invalid packet size\n"); |
163 | return -EINVAL; | 163 | return -EINVAL; |
@@ -170,8 +170,8 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
170 | goto out; | 170 | goto out; |
171 | } | 171 | } |
172 | 172 | ||
173 | if (len >= sizeof(struct icmp_packet_rr)) | 173 | if (len >= sizeof(struct batadv_icmp_packet_rr)) |
174 | packet_len = sizeof(struct icmp_packet_rr); | 174 | packet_len = sizeof(struct batadv_icmp_packet_rr); |
175 | 175 | ||
176 | skb = dev_alloc_skb(packet_len + ETH_HLEN); | 176 | skb = dev_alloc_skb(packet_len + ETH_HLEN); |
177 | if (!skb) { | 177 | if (!skb) { |
@@ -180,7 +180,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
180 | } | 180 | } |
181 | 181 | ||
182 | skb_reserve(skb, ETH_HLEN); | 182 | skb_reserve(skb, ETH_HLEN); |
183 | icmp_packet = (struct icmp_packet_rr *)skb_put(skb, packet_len); | 183 | icmp_packet = (struct batadv_icmp_packet_rr *)skb_put(skb, packet_len); |
184 | 184 | ||
185 | if (copy_from_user(icmp_packet, buff, packet_len)) { | 185 | if (copy_from_user(icmp_packet, buff, packet_len)) { |
186 | len = -EFAULT; | 186 | len = -EFAULT; |
@@ -231,7 +231,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff, | |||
231 | memcpy(icmp_packet->orig, | 231 | memcpy(icmp_packet->orig, |
232 | primary_if->net_dev->dev_addr, ETH_ALEN); | 232 | primary_if->net_dev->dev_addr, ETH_ALEN); |
233 | 233 | ||
234 | if (packet_len == sizeof(struct icmp_packet_rr)) | 234 | if (packet_len == sizeof(struct batadv_icmp_packet_rr)) |
235 | memcpy(icmp_packet->rr, | 235 | memcpy(icmp_packet->rr, |
236 | neigh_node->if_incoming->net_dev->dev_addr, ETH_ALEN); | 236 | neigh_node->if_incoming->net_dev->dev_addr, ETH_ALEN); |
237 | 237 | ||
@@ -294,7 +294,7 @@ err: | |||
294 | } | 294 | } |
295 | 295 | ||
296 | static void batadv_socket_add_packet(struct socket_client *socket_client, | 296 | static void batadv_socket_add_packet(struct socket_client *socket_client, |
297 | struct icmp_packet_rr *icmp_packet, | 297 | struct batadv_icmp_packet_rr *icmp_packet, |
298 | size_t icmp_len) | 298 | size_t icmp_len) |
299 | { | 299 | { |
300 | struct socket_packet *socket_packet; | 300 | struct socket_packet *socket_packet; |
@@ -336,7 +336,7 @@ static void batadv_socket_add_packet(struct socket_client *socket_client, | |||
336 | wake_up(&socket_client->queue_wait); | 336 | wake_up(&socket_client->queue_wait); |
337 | } | 337 | } |
338 | 338 | ||
339 | void batadv_socket_receive_packet(struct icmp_packet_rr *icmp_packet, | 339 | void batadv_socket_receive_packet(struct batadv_icmp_packet_rr *icmp_packet, |
340 | size_t icmp_len) | 340 | size_t icmp_len) |
341 | { | 341 | { |
342 | struct socket_client *hash; | 342 | struct socket_client *hash; |