summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2000-06-05 17:41:44 +0200
committerPavel Machek <pavel@ucw.cz>2000-06-05 17:41:44 +0200
commit8b79c4ccd597b90222f57eb3dfadeb24f39db7bd (patch)
treed811a8f78ad7b39352446ea5bf03f14f53d92fdf /proto
parent98da26a0a0ee9dd8f7030dcaf6f733adf8b8ad2c (diff)
downloadbird-8b79c4ccd597b90222f57eb3dfadeb24f39db7bd.tar
bird-8b79c4ccd597b90222f57eb3dfadeb24f39db7bd.zip
Add safety check.
Diffstat (limited to 'proto')
-rw-r--r--proto/rip/rip.c6
-rw-r--r--proto/rip/rip.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 698f0e2..643fc43 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -53,6 +53,7 @@
#include "lib/string.h"
#include "rip.h"
+#include <assert.h>
#define P ((struct rip_proto *) p)
#define P_CF ((struct rip_proto_config *)p->cf)
@@ -538,6 +539,11 @@ rip_start(struct proto *p)
struct rip_interface *rif;
DBG( "RIP: starting instance...\n" );
+ assert( sizeof(struct rip_packet_heading) == 4);
+ assert( sizeof(struct rip_block) == 20);
+ assert( sizeof(struct rip_block_auth) == 20);
+
+
P->magic = RIP_MAGIC;
fib_init( &P->rtable, p->pool, sizeof( struct rip_entry ), 0, NULL );
init_list( &P->connections );
diff --git a/proto/rip/rip.h b/proto/rip/rip.h
index 67fd5b0..30002ea 100644
--- a/proto/rip/rip.h
+++ b/proto/rip/rip.h
@@ -52,7 +52,7 @@ struct rip_block { /* 20 bytes */
u32 metric;
};
#else
-struct rip_block { /* IPv6 version! */
+struct rip_block { /* IPv6 version!, 20 bytes, too */
ip_addr network;
u16 tag;
u8 pxlen;