aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/icmp_socket.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-11-20 09:47:38 -0500
committerMarek Lindner <lindner_marek@yahoo.de>2012-02-16 13:50:19 -0500
commit76543d14aec6ce5cb3fc7be9b39c50fcebd2043b (patch)
tree4f739cfadaee8ec9a06d7855956f3accc1dcc2be /net/batman-adv/icmp_socket.c
parent17071578888c7c18709e48e74fae228c04581b9a (diff)
batman-adv: Explicitly mark the common header structure
All batman-adv packets have a common 3 byte header. It can be used to share some code between different code paths, but it was never explicit stated that this header has to be always the same for all packets. Therefore, new code changes always have the problem that they may accidently introduce regressions by moving some elements around. A new structure is introduced that contains the common header and makes it easier visible that these 3 bytes have to be the same for all on-wire packets. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/icmp_socket.c')
-rw-r--r--net/batman-adv/icmp_socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index d9c1e7bb7fbf..5d69e103faa1 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -191,7 +191,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
191 goto free_skb; 191 goto free_skb;
192 } 192 }
193 193
194 if (icmp_packet->packet_type != BAT_ICMP) { 194 if (icmp_packet->header.packet_type != BAT_ICMP) {
195 bat_dbg(DBG_BATMAN, bat_priv, 195 bat_dbg(DBG_BATMAN, bat_priv,
196 "Error - can't send packet from char device: " 196 "Error - can't send packet from char device: "
197 "got bogus packet type (expected: BAT_ICMP)\n"); 197 "got bogus packet type (expected: BAT_ICMP)\n");
@@ -209,9 +209,9 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
209 209
210 icmp_packet->uid = socket_client->index; 210 icmp_packet->uid = socket_client->index;
211 211
212 if (icmp_packet->version != COMPAT_VERSION) { 212 if (icmp_packet->header.version != COMPAT_VERSION) {
213 icmp_packet->msg_type = PARAMETER_PROBLEM; 213 icmp_packet->msg_type = PARAMETER_PROBLEM;
214 icmp_packet->version = COMPAT_VERSION; 214 icmp_packet->header.version = COMPAT_VERSION;
215 bat_socket_add_packet(socket_client, icmp_packet, packet_len); 215 bat_socket_add_packet(socket_client, icmp_packet, packet_len);
216 goto free_skb; 216 goto free_skb;
217 } 217 }