[quagga-dev 4349] Ospf6d redistribution BUG

Spagnolo, Phillip A phillip.a.spagnolo at boeing.com
Fri Sep 8 19:59:11 BST 2006

In quagga-0.98.6, there is a bug when setting an external LSA to type-2
or setting the metric when using route-maps.

Ospf6d assumes the return value of route_map_apply should be RMAP_MATCH.
However, when setting a metric then the return value will be RMAP_OKAY.
See the function ospf6_routemap_rule_set_metric() below.

Let me know if I am missing something.


In ospf6_asbr_redistribute_add(), the following change should be made.
It is labeled with BUGFIX.

  /* apply route-map */
  if (ospf6->rmap[type].map)
      memset (&troute, 0, sizeof (troute));
      memset (&tinfo, 0, sizeof (tinfo));
      troute.route_option = &tinfo;

      ret = route_map_apply (ospf6->rmap[type].map, prefix,
                             RMAP_OSPF6, &troute);
#ifdef BUGFIX
      if (!(ret == RMAP_MATCH || ret == RMAP_OKAY))
      if (ret != RMAP_MATCH)
#endif //BUGFIX

ospf6_routemap_rule_set_metric (void *rule, struct prefix *prefix,
                                route_map_object_t type, void *object)
  char *metric = (char *) rule;
  struct ospf6_route *route = (struct ospf6_route *) object;

zlog_debug("test ospf6_routemap_rule_set_metric");

  if (type != RMAP_OSPF6)
    return RMAP_OKAY;

  route->path.cost = atoi (metric);
  return RMAP_OKAY;

More information about the Quagga-dev mailing list