diff options
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 |