[Olsr-dev] Quagga plugin CPPFLAGS ignored

Acinonyx (spam-protected)
Fri Oct 12 20:05:08 CEST 2007


On Friday 12 October 2007 11:32:52 Hannes Gredler wrote:
> hi vassilis,
>
> see comments inline prefixed by HG>.
>
> On Thu, Oct 11, 2007 at 11:30:37PM +0300, Acinonyx wrote:
> | diff -Nur olsrd-current/lib/quagga/src/quagga.c
> | olsrd-current-patched/lib/quagga/src/quagga.c ---
> | olsrd-current/lib/quagga/src/quagga.c	2007-10-11 22:08:23.000000000 +0300
> | +++ olsrd-current-patched/lib/quagga/src/quagga.c	2007-10-11
> | 22:43:48.000000000 +0300 @@ -160,7 +160,7 @@
> |
> |  void init_zebra (void) {
> |    zebra_connect();
> | -  if (!zebra.status&STATUS_CONNECTED)
> | +  if (!(zebra.status&STATUS_CONNECTED))
> |      olsr_exit ("(QUAGGA) AIIIII, could not connect to zebra! is zebra
> | running?", EXIT_FAILURE);
> |  }
> | @@ -185,7 +185,7 @@
> |    int i;
> |
> |    zebra_connect();
> | -  if (!zebra.status & STATUS_CONNECTED) return; // try again next time
> | +  if (!(zebra.status & STATUS_CONNECTED)) return; // try again next time
> |
> |    if (zebra.options & OPTION_EXPORT) {
> |      OLSR_FOR_ALL_RT_ENTRIES(tmp) {
> | @@ -244,6 +244,9 @@
> |  unsigned char zebra_send_command (unsigned char command,
> |                                    unsigned char *options, int optlen) {
> |
> | +  if (!(zebra.status & STATUS_CONNECTED))
> | +    return 0;
> | +
> |  #ifdef ZEBRA_HEADER_MARKER
> |    char *p = olsr_malloc (optlen + 6, "zebra_send_command");
> |    uint16_t length = optlen + 6; /* length of option + command +
> | packet_length + @@ -441,9 +444,13 @@
> |        free (buf);
> |        return NULL;
> |      }
> | -    if (ret < 0 && errno != EAGAIN) { // oops - we got disconnected
> | -      olsr_printf (1, "(QUAGGA) Disconnected from zebra\n");
> | -      zebra.status &= ~STATUS_CONNECTED;
> | +    if (ret < 0) {
> | +      if (errno != EAGAIN) { // oops - we got disconnected
> | +        olsr_printf (1, "(QUAGGA) Disconnected from zebra\n");
> | +        zebra.status &= ~STATUS_CONNECTED;
> | +      }
> | +      free (buf);
> | +      return NULL;
> |      }
> |
> |      *len += ret;
> | @@ -792,13 +799,13 @@
> |    route.flags = zebra.flags;
> |    route.prefixlen = r->rt_dst.prefix_len;
> |    route.prefix = r->rt_dst.prefix.v4;
> | -  if ((r->rt_best->rtp_nexthop.gateway.v4 == r->rt_dst.prefix.v4 &&
> | +  if ((r->rt_nexthop.gateway.v4 == r->rt_dst.prefix.v4 &&
> |         route.prefixlen == 32)){
> |      route.message |= ZAPI_MESSAGE_IFINDEX;
> |      route.ind_num = 1;
> |      route.index = olsr_malloc (sizeof *route.index,
> |  			       "zebra_add_olsr_v4_route");
> | -    *route.index = htonl (r->rt_best->rtp_nexthop.iif_index);
> | +    *route.index = htonl (r->rt_nexthop.iif_index);
> |      route.nexthops = olsr_malloc (sizeof route.nexthops->type +
> |  				  sizeof route.nexthops->payload,
> |  				  "zebra_add_olsr_v4_route");
> | @@ -813,10 +820,9 @@
> |  				   sizeof route.nexthops->payload),
> |  				  "zebra_add_olsr_v4_route");
> |      route.nexthops->type = ZEBRA_NEXTHOP_IPV4;
> | -    route.nexthops->payload.v4 = r->rt_best->rtp_nexthop.gateway.v4;
> | +    route.nexthops->payload.v4 = r->rt_nexthop.gateway.v4;
> |    }
> | -  route.metric = r->rt_best->rtp_metric.hops;
> | -  route.metric = htonl (route.metric);
> | +  route.metric = 0;
>
> HG> why are you changing that ? - i was under the impression that
>     you need the metric for the BGP MED export ?
>
> |    if (zebra.distance) {
> |      route.message |= ZAPI_MESSAGE_DISTANCE;
> | diff -Nur olsrd-current/lib/quagga/version-script.txt
> | olsrd-current-patched/lib/quagga/version-script.txt ---
> | olsrd-current/lib/quagga/version-script.txt	2007-10-11 22:08:21.000000000
> | +0300 +++ olsrd-current-patched/lib/quagga/version-script.txt	2007-10-11
> | 22:34:31.000000000 +0300 @@ -2,8 +2,8 @@
> |  {
> |    global:
> |      olsrd_plugin_interface_version;
> | -    olsrd_plugin_register_param;
> |      olsrd_plugin_init;
> | +    olsrd_get_plugin_parameters;
> |
> |    local:
> |      *;
> |
> | --
> | Olsr-dev mailing list
> | (spam-protected)
> | http://lists.olsr.org/mailman/listinfo/olsr-dev

Hello Hannes,

this is the same as kernel routes. There is no need to specify route metric 
when deleting routes. Even if a metric is set, zebra will just ignore it.

Metric is still passed to zebra when adding routes.

Vassilis






More information about the Olsr-dev mailing list