Mailing List Archive

PATCH: send DISTANCE to zebra's client
Hello,

I have worked on ripd code for some time now. The goal is to allow ripd to
store all valid routes to destination, not only the best one, like cisco
and other decent rip routers do. Now, when route expires, ripd stucks
without valid route until it receives update from neighbor. It is also not
possible to keep high distance static route as a last resort - ripd
allways found static routes as best ones. When I finish my patch I will publish
it to the list, but before I do this I need to fix some other bugs not
strictly related to ripd.

Currently zebra does not send "distance". This patch fix this.

diff -Nur quagga-0.96.4-orig/zebra/zserv.c quagga-0.96.4/zebra/zserv.c
--- quagga-0.96.4-orig/zebra/zserv.c Sun Jun 15 03:28:30 2003
+++ quagga-0.96.4/zebra/zserv.c Mon Nov 10 04:47:11 2003
@@ -432,7 +432,8 @@
stream_putc (s, ZEBRA_IPV4_ROUTE_ADD);
stream_putc (s, rib->type);
stream_putc (s, rib->flags);
- stream_putc (s, ZAPI_MESSAGE_NEXTHOP | ZAPI_MESSAGE_IFINDEX | ZAPI_MESSAGE_METRIC);
+ stream_putc (s, ZAPI_MESSAGE_NEXTHOP | ZAPI_MESSAGE_IFINDEX |
+ ZAPI_MESSAGE_DISTANCE | ZAPI_MESSAGE_METRIC);

/* Prefix. */
psize = PSIZE (p->prefixlen);
@@ -461,6 +462,9 @@
}
}

+ /* Distance */
+ stream_putc (s, rib->distance);
+
/* Metric */
stream_putl (s, rib->metric);

@@ -678,7 +682,8 @@
stream_putc (s, ZEBRA_IPV6_ROUTE_ADD);
stream_putc (s, rib->type);
stream_putc (s, rib->flags);
- stream_putc (s, ZAPI_MESSAGE_NEXTHOP | ZAPI_MESSAGE_IFINDEX | ZAPI_MESSAGE_METRIC);
+ stream_putc (s, ZAPI_MESSAGE_NEXTHOP | ZAPI_MESSAGE_IFINDEX |
+ ZAPI_MESSAGE_DISTANCE | ZAPI_MESSAGE_METRIC );

/* Prefix. */
psize = PSIZE (p->prefixlen);
@@ -706,6 +711,9 @@
break;
}
}
+
+ /* Distance */
+ stream_putc (s, rib->distance);

/* Metric */
stream_putl (s, rib->metric);


Best regards,

Krzysztof Olêdzki