secure: initialise cmsg correctly
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 08:06:28 +0000 (10:06 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 08:52:49 +0000 (10:52 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/secure/src/olsrd_secure.c

index 07160d7..92ea42d 100644 (file)
@@ -538,13 +538,14 @@ send_challenge(struct interface *olsr_if, const union olsr_ip_addr *new_host)
   challenge = rand() << 16;
   challenge |= rand();
 
+  /* initialise rrmsg */
+  memset(&cmsg, 0, sizeof(cmsg));
+
   /* Fill challengemessage */
   cmsg.olsr_msgtype = TYPE_CHALLENGE;
-  cmsg.olsr_vtime = 0;
   cmsg.olsr_msgsize = htons(sizeof(struct challengemsg));
   memcpy(&cmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
   cmsg.ttl = 1;
-  cmsg.hopcnt = 0;
   cmsg.seqno = htons(get_msg_seqno());
 
   /* Fill subheader */