diff options
author | Pavel Machek <pavel@ucw.cz> | 1998-12-01 17:17:10 +0100 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 1998-12-01 17:17:10 +0100 |
commit | 9b999c393c6f89a73d5fe0f4e152b77ca0afb1b2 (patch) | |
tree | 4ffb78e20348f32f09a45e116de72fa640fa8e9f /proto/rip/rip.c | |
parent | 50d8424ad1f40f9979214c1d6cbf8e290ba9a5cb (diff) | |
download | bird-9b999c393c6f89a73d5fe0f4e152b77ca0afb1b2.tar bird-9b999c393c6f89a73d5fe0f4e152b77ca0afb1b2.zip |
Infinity is now configurable ammount.
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r-- | proto/rip/rip.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 79b22df..23e8645 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -22,8 +22,6 @@ #include "rip.h" -int infinity = 16; - /* FIXME: should be 520 */ #define RIP_PORT 1520 @@ -160,7 +158,7 @@ givemore: if (ipa_equal(c->sendptr->whotoldme, s->daddr)) { debug( "(split horizont)" ); /* FIXME: should we do it in all cases? */ - packet->block[i].metric = infinity; + packet->block[i].metric = P->infinity; } ipa_hton( packet->block[i].network ); ipa_hton( packet->block[i].netmask ); @@ -278,7 +276,7 @@ process_block( struct proto *p, struct rip_block *block, ip_addr whotoldme ) ip_addr network = block->network; CHK_MAGIC; - if ((!metric) || (metric > infinity)) { + if ((!metric) || (metric > P->infinity)) { log( L_WARN "Got metric %d from %I\n", metric, whotoldme ); return; } @@ -286,7 +284,7 @@ process_block( struct proto *p, struct rip_block *block, ip_addr whotoldme ) /* FIXME: Check if destination looks valid - ie not net 0 or 127 */ /* FIXME: Should add configurable ammount */ - if (metric < infinity) + if (metric < P->infinity) metric++; debug( "block: %I tells me: %I/%I available, metric %d... ", whotoldme, network, block->netmask, metric ); @@ -622,6 +620,7 @@ rip_init_instance(struct proto *p) p->rte_insert = rip_rte_insert; p->rte_remove = rip_rte_remove; p->dump = rip_dump; + P->infinity = 16; } static void |