vty_out(vty, " ");
}
-static char *bgp_nexthop_hostname(struct peer *peer, struct attr *attr)
+static char *bgp_nexthop_hostname(struct peer *peer,
+ struct bgp_nexthop_cache *bnc)
{
- if (peer->hostname && bgp_flag_check(peer->bgp, BGP_FLAG_SHOW_HOSTNAME)
- && !(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)))
+ if (peer->hostname
+ && CHECK_FLAG(peer->bgp->flags, BGP_FLAG_SHOW_HOSTNAME)
+ && CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))
return peer->hostname;
return NULL;
}
bool nexthop_othervrf = false;
vrf_id_t nexthop_vrfid = VRF_DEFAULT;
const char *nexthop_vrfname = VRF_DEFAULT_NAME;
- char *nexthop_hostname = bgp_nexthop_hostname(path->peer, attr);
+ char *nexthop_hostname =
+ bgp_nexthop_hostname(path->peer, path->nexthop);
if (json_paths)
json_path = json_object_new_object();
bool nexthop_self =
CHECK_FLAG(path->flags, BGP_PATH_ANNC_NH_SELF) ? true : false;
int i;
- char *nexthop_hostname = bgp_nexthop_hostname(path->peer, attr);
+ char *nexthop_hostname =
+ bgp_nexthop_hostname(path->peer, path->nexthop);
if (json_paths) {
json_path = json_object_new_object();