stream_putc(s, api->type);
stream_putw(s, api->instance);
+ if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TABLEID))
+ SET_FLAG(api->flags, ZEBRA_FLAG_TABLEID);
stream_putl(s, api->flags);
stream_putl(s, api->message);
return -1;
}
+ if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TABLEID))
+ SET_FLAG(api->flags, ZEBRA_FLAG_TABLEID);
if (zapi_nexthop_encode(s, api_nh, api->flags,
api->message)
!= 0)
return -1;
}
+ if (CHECK_FLAG(api->message, ZAPI_MESSAGE_TABLEID))
+ SET_FLAG(api->flags, ZEBRA_FLAG_TABLEID);
+
if (zapi_nexthop_encode(s, api_nh, api->flags,
api->message)
!= 0)
* kernel (NLM_F_APPEND at the very least )
*/
#define ZEBRA_FLAG_OUTOFSYNC 0x400
+/*
+ * This flag lets us know that the route entry is
+ * associated to the table ID and must remain when the
+ * table ID is de-associated from a VRF.
+ */
+#define ZEBRA_FLAG_TABLEID 0x800
/* The older XXX_MESSAGE flags live here */
uint32_t message;
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
"installed": true,
"table": 254,
"internalStatus": 16,
- "internalFlags": 9,
+ "internalFlags": 2057,
"nexthops": [
{
"flags": 3,
/* Assign the kernel route entries to the default VRF,
* even though they are not actually owned by it.
*
- * Remove route nodes that have been created by FRR daemons.
- * They are not needed if the VRF is disabled.
+ * Remove route nodes that were created by FRR daemons,
+ * unless they are associated with the table rather than the VRF.
+ * Routes associated with the VRF are not needed once the VRF is
+ * disabled.
*/
rn_delete = true;
RNODE_FOREACH_RE_SAFE (rn, re, nre) {
- if (re->type == ZEBRA_ROUTE_KERNEL) {
+ if (re->type == ZEBRA_ROUTE_KERNEL ||
+ CHECK_FLAG(re->flags, ZEBRA_FLAG_TABLEID)) {
nexthop_vrf_update(rn, re, VRF_DEFAULT);
+ if (CHECK_FLAG(re->flags, ZEBRA_FLAG_TABLEID))
+ /* reinstall routes */
+ rib_install_kernel(rn, re, NULL);
rn_delete = false;
} else
rib_unlink(rn, re);