diff options
author | vincent <vincent> | 2006-01-30 18:12:42 +0000 |
---|---|---|
committer | vincent <vincent> | 2006-01-30 18:12:42 +0000 |
commit | b3863de0c9a64bc6d0febb4614d69c2ff15293ab (patch) | |
tree | 2f845121bc86125373f38c14c90a1a598dc741e4 /ripd/ripd.c | |
parent | 94cbbe89ccbd6a9049b5227da55715a5ce3f0a94 (diff) | |
download | quagga-b3863de0c9a64bc6d0febb4614d69c2ff15293ab.tar.bz2 quagga-b3863de0c9a64bc6d0febb4614d69c2ff15293ab.tar.xz |
ripd.c: correct bug that allowed route learnt through RIP to take precedence over connected routes
Diffstat (limited to 'ripd/ripd.c')
-rw-r--r-- | ripd/ripd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c index 40db33f5..c8aa5221 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -486,7 +486,9 @@ rip_rte_process (struct rte *rte, struct sockaddr_in *from, new_dist = rip_distance_apply (&rinfotmp); new_dist = new_dist ? new_dist : ZEBRA_RIP_DISTANCE_DEFAULT; old_dist = rinfo->distance; - old_dist = old_dist ? old_dist : ZEBRA_RIP_DISTANCE_DEFAULT; + /* Only connected routes may have a valid NULL distance */ + if (rinfo->type != ZEBRA_ROUTE_CONNECT) + old_dist = old_dist ? old_dist : ZEBRA_RIP_DISTANCE_DEFAULT; /* If imported route does not have STRICT precedence, mark it as a ghost */ if (new_dist > old_dist |