diff options
author | vincent <vincent> | 2006-01-30 18:12:42 +0000 |
---|---|---|
committer | vincent <vincent> | 2006-01-30 18:12:42 +0000 |
commit | 7a383339572b0dd1098132ba35c5f8dc34885fd1 (patch) | |
tree | 475efdb55c563aace907e0b4579eacbaf20a3bea /ripd | |
parent | a1038a15658d2fd4ab3314a9036bbd63f8f471c1 (diff) |
ripd.c: correct bug that allowed route learnt through RIP to take precedence over connected routes
Diffstat (limited to 'ripd')
-rw-r--r-- | ripd/ChangeLog | 5 | ||||
-rw-r--r-- | ripd/ripd.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ripd/ChangeLog b/ripd/ChangeLog index c979a11d..d795509e 100644 --- a/ripd/ChangeLog +++ b/ripd/ChangeLog @@ -1,3 +1,8 @@ +2006-01-30 Alain Ritoux <alain.ritoux@6wind.com> + + * ripd.c: correct bug that allowed route learnt through RIP to take + precedence over connectd routes + 2006-01-19 Paul Jakma <paul.jakma@sun.com> * ripd.c: (main) return from main, not exit, cause it annoys SOS. 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 |