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

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/secure/src/olsrd_secure.c

index 5f37b87..2a88bb4 100644 (file)
@@ -913,6 +913,7 @@ send_cres(struct interface *olsr_if, union olsr_ip_addr *to, union olsr_ip_addr
 #endif /* _WIN32 */
 
   /* Fill subheader */
+  assert(olsr_cnf->ipsize == sizeof(crmsg.destination));
   memcpy(&crmsg.destination, to, olsr_cnf->ipsize);
   crmsg.challenge = htonl(challenge);