{
struct bgp_node *rn;
- /* If zebra is not enabled return */
- if (zlookup->sock < 0)
- return 1;
-
/* Lookup the address is onlink or not. */
if (afi == AFI_IP)
{
struct bgp_nexthop_cache *bnc;
struct attr *attr;
- /* If lookup is not enabled, return valid. */
- if (zlookup->sock < 0)
- {
- if (ri->extra)
- ri->extra->igpmetric = 0;
- return 1;
- }
-
/* Only check IPv6 global address only nexthop. */
attr = ri->attr;
}
else
{
- bnc = zlookup_query_ipv6 (&attr->extra->mp_nexthop_global);
- if (bnc)
+ if (NULL == (bnc = zlookup_query_ipv6 (&attr->extra->mp_nexthop_global)))
+ bnc = bnc_new ();
+ else
{
if (changed)
{
}
}
}
- else
- {
- bnc = bnc_new ();
- }
rn->info = bnc;
}
struct bgp_nexthop_cache *bnc;
struct in_addr addr;
- /* If lookup is not enabled, return valid. */
- if (zlookup->sock < 0)
- {
- if (ri->extra)
- ri->extra->igpmetric = 0;
- return 1;
- }
-
#ifdef HAVE_IPV6
if (afi == AFI_IP6)
return bgp_nexthop_lookup_ipv6 (peer, ri, changed, metricchanged);
}
else
{
- bnc = zlookup_query (addr);
- if (bnc)
+ if (NULL == (bnc = zlookup_query (addr)))
+ bnc = bnc_new ();
+ else
{
if (changed)
{
}
}
}
- else
- {
- bnc = bnc_new ();
- }
rn->info = bnc;
}