Revision 7e95c05d proto/bgp/attrs.c

View differences:

proto/bgp/attrs.c
1015 1015
    return ((struct bgp_proto *) r->attrs->proto)->remote_as;
1016 1016
}
1017 1017

  
1018
static inline int
1019
rte_resolvable(rte *rt)
1020
{
1021
  int rd = rt->attrs->dest;  
1022
  return (rd == RTD_ROUTER) || (rd == RTD_DEVICE) || (rd == RTD_MULTIPATH);
1023
}
1024

  
1018 1025
int
1019 1026
bgp_rte_better(rte *new, rte *old)
1020 1027
{
......
1024 1031
  u32 n, o;
1025 1032

  
1026 1033
  /* RFC 4271 9.1.2.1. Route resolvability test */
1027
  /* non-NULL iface means it is either RTD_ROUTER or RTD_DEVICE route */
1028
  n = new->attrs->iface != NULL;
1029
  o = old->attrs->iface != NULL;
1034
  n = rte_resolvable(new);
1035
  o = rte_resolvable(old);
1030 1036
  if (n > o)
1031 1037
    return 1;
1032 1038
  if (n < o)
......
1502 1508
  buf += bsprintf(buf, " (%d", e->pref);
1503 1509
  if (e->attrs->hostentry)
1504 1510
    {
1505
      if (!e->attrs->iface)
1511
      if (!rte_resolvable(e))
1506 1512
	buf += bsprintf(buf, "/-");
1507 1513
      else if (e->attrs->igp_metric >= IGP_METRIC_UNKNOWN)
1508 1514
	buf += bsprintf(buf, "/?");

Also available in: Unified diff