secure: can only work for IPv4, so assert on it
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 08:05:27 +0000 (10:05 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 08:52:48 +0000 (10:52 +0200)
Because of:
  memcpy(&cmsg.destination, new_host, olsr_cnf->ipsize);
with
  cmsg.destination being an uint32_t

lib/secure/src/olsrd_secure.c

index 53fdb55..4b040c3 100644 (file)
@@ -548,6 +548,7 @@ send_challenge(struct interface *olsr_if, const union olsr_ip_addr *new_host)
   cmsg.seqno = htons(get_msg_seqno());
 
   /* Fill subheader */
+  assert(olsr_cnf->ipsize == sizeof(cmsg.destination));
   memcpy(&cmsg.destination, new_host, olsr_cnf->ipsize);
   cmsg.challenge = htonl(challenge);