summaryrefslogtreecommitdiffstats
path: root/zebra/zserv.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 432c3182..85f448c4 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -36,6 +36,7 @@
#include "privs.h"
#include "network.h"
#include "buffer.h"
+#include "vrf.h"
#include "zebra/zserv.h"
#include "zebra/router-id.h"
@@ -473,7 +474,7 @@ zsend_ipv6_nexthop_lookup (struct zserv *client, struct in6_addr *addr)
struct nexthop *nexthop;
/* Lookup nexthop. */
- rib = rib_match_ipv6 (addr);
+ rib = rib_match_ipv6 (addr, VRF_DEFAULT);
/* Get output stream. */
s = client->obuf;
@@ -540,7 +541,7 @@ zsend_ipv4_nexthop_lookup (struct zserv *client, struct in_addr addr)
struct nexthop *nexthop;
/* Lookup nexthop - eBGP excluded */
- rib = rib_match_ipv4_safi (addr, SAFI_UNICAST, 1, NULL);
+ rib = rib_match_ipv4_safi (addr, SAFI_UNICAST, 1, NULL, VRF_DEFAULT);
/* Get output stream. */
s = client->obuf;
@@ -679,7 +680,7 @@ zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p)
struct nexthop *nexthop;
/* Lookup nexthop. */
- rib = rib_lookup_ipv4 (p);
+ rib = rib_lookup_ipv4 (p, VRF_DEFAULT);
/* Get output stream. */
s = client->obuf;
@@ -842,6 +843,9 @@ zread_ipv4_add (struct zserv *client, u_short length)
p.prefixlen = stream_getc (s);
stream_get (&p.prefix, s, PSIZE (p.prefixlen));
+ /* VRF ID */
+ rib->vrf_id = VRF_DEFAULT;
+
/* Nexthop parse. */
if (CHECK_FLAG (message, ZAPI_MESSAGE_NEXTHOP))
{
@@ -972,7 +976,7 @@ zread_ipv4_delete (struct zserv *client, u_short length)
api.metric = 0;
rib_delete_ipv4 (api.type, api.flags, &p, nexthop_p, ifindex,
- client->rtm_table, api.safi);
+ VRF_DEFAULT, api.safi);
return 0;
}
@@ -998,7 +1002,7 @@ zread_ipv4_nexthop_lookup_mrib (struct zserv *client, u_short length)
struct rib *rib;
addr.s_addr = stream_get_ipv4 (client->ibuf);
- rib = rib_match_ipv4_multicast (addr, NULL);
+ rib = rib_match_ipv4_multicast (addr, NULL, VRF_DEFAULT);
return zsend_ipv4_nexthop_lookup_mrib (client, addr, rib);
}
@@ -1076,11 +1080,13 @@ zread_ipv6_add (struct zserv *client, u_short length)
api.metric = 0;
if (IN6_IS_ADDR_UNSPECIFIED (&nexthop))
- rib_add_ipv6 (api.type, api.flags, &p, NULL, ifindex, zebrad.rtm_table_default, api.metric,
- api.distance, api.safi);
+ rib_add_ipv6 (api.type, api.flags, &p, NULL, ifindex,
+ VRF_DEFAULT, zebrad.rtm_table_default, api.metric,
+ api.distance, api.safi);
else
- rib_add_ipv6 (api.type, api.flags, &p, &nexthop, ifindex, zebrad.rtm_table_default, api.metric,
- api.distance, api.safi);
+ rib_add_ipv6 (api.type, api.flags, &p, &nexthop, ifindex,
+ VRF_DEFAULT, zebrad.rtm_table_default, api.metric,
+ api.distance, api.safi);
return 0;
}
@@ -1143,9 +1149,11 @@ zread_ipv6_delete (struct zserv *client, u_short length)
api.metric = 0;
if (IN6_IS_ADDR_UNSPECIFIED (&nexthop))
- rib_delete_ipv6 (api.type, api.flags, &p, NULL, ifindex, client->rtm_table, api.safi);
+ rib_delete_ipv6 (api.type, api.flags, &p, NULL, ifindex, VRF_DEFAULT,
+ api.safi);
else
- rib_delete_ipv6 (api.type, api.flags, &p, &nexthop, ifindex, client->rtm_table, api.safi);
+ rib_delete_ipv6 (api.type, api.flags, &p, &nexthop, ifindex, VRF_DEFAULT,
+ api.safi);
return 0;
}