struct rib *same = NULL;
struct nexthop *nexthop;
int ret = 0;
+ int family;
+
+ if (!rib)
+ return 0;
if (p->family == AF_INET)
- {
- if (!rib)
- return 0;
+ family = AFI_IP;
+ else
+ family = AFI_IP6;
- table = zebra_vrf_table (AFI_IP, safi, rib->vrf_id);
- if (!table)
- return 0;
+ /* Lookup table. */
+ table = zebra_vrf_table_with_table_id (family, safi, rib->vrf_id, rib->table);
+ if (! table)
+ return 0;
+
+ if (p->family == AF_INET)
+ {
/* Make it sure prefixlen is applied to the prefix. */
apply_mask_ipv4 ((struct prefix_ipv4 *)p);
}
else
{
- if (!rib)
- return 0; /* why are we getting called with NULL rib */
-
- /* Lookup table. */
- table = zebra_vrf_table_with_table_id (AFI_IP6, safi, rib->vrf_id, rib->table);
- if (! table)
- return 0;
-
/* Make sure mask is applied. */
apply_mask_ipv6 ((struct prefix_ipv6 *)p);
-
}
/* Set default distance by route type. */
p.prefixlen = stream_getc (s);
stream_get (&p.prefix, s, PSIZE (p.prefixlen));
+ /* VRF ID */
+ rib->vrf_id = vrf_id;
+
/* We need to give nh-addr, nh-ifindex with the same next-hop object
* to the rib to ensure that IPv6 multipathing works; need to coalesce
* these. Clients should send the same number of paired set of
else
rib->tag = 0;
+ /* VRF ID */
rib->vrf_id = vrf_id;
+
/* Table */
if (vrf_id)
{