]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ripd: correctly redistribute ifindex routes (BZ#664)
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 28 Feb 2013 21:17:00 +0000 (22:17 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 9 Apr 2013 20:33:19 +0000 (22:33 +0200)
ripd had a check to restrict metric 0 to only directly connected routes.
This check was implemented by checking against Connected as route type.
This is, however, incorrect -- all routes that directly use an interface
without a nexthop should be treated as directly connected and passed off
with metric 0.

ripngd does not posess such a check and was not touched.

Reported-by: Sean Fulton <sean@gcnpublishing.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ripd/ripd.c

index db29d54a2dd21f56e078db625641dfc5c54f24f3..55a1a75f1d10e4c58c611e659eb68cef8ed5c0fa 100644 (file)
@@ -482,8 +482,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;
-          /* Only connected routes may have a valid NULL distance */
-          if (rinfo->type != ZEBRA_ROUTE_CONNECT)
+          /* Only routes directly connected to an interface (nexthop == 0)
+          * may have a valid NULL distance */
+          if (rinfo->nexthop.s_addr != 0)
             old_dist = old_dist ? old_dist : ZEBRA_RIP_DISTANCE_DEFAULT;
           /* If imported route does not have STRICT precedence, 
              mark it as a ghost */