ripd.c: correct bug that allowed route learnt through RIP to take precedence over connected routes
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 40db33f..c8aa522 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -486,7 +486,9 @@
           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