diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-01-05 11:34:44 +0000 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-01-05 11:34:44 +0000 |
commit | 4a6acac1becf0af0be0deb9fc17d4cdcf8595071 (patch) | |
tree | ff45109338a72998cd29148605a2c3dad10cfa37 /lib/sockunion.h | |
parent | 0f32dcb7962d74cfc2289974d58c4c8b4794167d (diff) | |
download | quagga-4a6acac1becf0af0be0deb9fc17d4cdcf8595071.tar.bz2 quagga-4a6acac1becf0af0be0deb9fc17d4cdcf8595071.tar.xz |
Tighten SU_ADDRSTRLEN and sockunion2str() in lib/sockunion.c/.h
Added confirms and assert for SU_ADDRSTRLEN in sockunion.h and in
sockunion2str().
Diffstat (limited to 'lib/sockunion.h')
-rw-r--r-- | lib/sockunion.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sockunion.h b/lib/sockunion.h index 2009da2f..97fd8b72 100644 --- a/lib/sockunion.h +++ b/lib/sockunion.h @@ -24,6 +24,7 @@ #define _ZEBRA_SOCKUNION_H #include "symtab.h" +#include "zassert.h" #if 0 union sockunion { @@ -63,9 +64,14 @@ enum connect_result #define AF_INET_UNION AF_INET #endif -/* Sockunion address string length. Same as INET6_ADDRSTRLEN. */ +/* Sockunion address string length. Accommodate either IPv4 or IPv6. */ #define SU_ADDRSTRLEN 46 +CONFIRM(SU_ADDRSTRLEN >= INET_ADDRSTRLEN) ; +#if HAVE_IPV6 +CONFIRM(SU_ADDRSTRLEN >= INET6_ADDRSTRLEN) ; +#endif + /* Macro to set link local index to the IPv6 address. For KAME IPv6 stack. */ #ifdef KAME |