]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Add safety check.
authorPavel Machek <pavel@ucw.cz>
Mon, 5 Jun 2000 15:41:44 +0000 (15:41 +0000)
committerPavel Machek <pavel@ucw.cz>
Mon, 5 Jun 2000 15:41:44 +0000 (15:41 +0000)
proto/rip/rip.c
proto/rip/rip.h

index 698f0e280c6f4175e7f04ad9629d185b7287f2cb..643fc4327cc51c5c02d1ad06b9751aebc2ef0d0e 100644 (file)
@@ -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 );
index 67fd5b0aac6afb3360fca6b7bb12481cff004e15..30002ea3607da606bb2f3f3c43b8b3f8bb15fb4f 100644 (file)
@@ -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;