aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-01-23 00:36:16 -0800
committerDamjan Marion <dmarion@me.com>2019-02-20 14:40:52 +0000
commitdc2a250f0616a3d853982b46597133780715bf57 (patch)
tree1bc1f49040ac76b3af7a4559fd06b3632a7e0f77 /src/vnet/ip
parent4c696abc8cf185ef18ed2baeb06304affee5ab39 (diff)
IP route local and connected
allow routes that are local and connected to be added via the API. this emulates the addition of a second address in the same subnet added to an interface. Change-Id: Ib18a08c26956be9a07b3360664210c8cf6734c84 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit 7425f9289bdc17d330044b0df0fc31cdeeca626b)
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip_api.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 42ce883c234..b9fa001553f 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -808,7 +808,13 @@ add_del_route_t_handler (u8 is_multipath,
path.frp_eos = MPLS_NON_EOS;
}
if (is_local)
- path_flags |= FIB_ROUTE_PATH_LOCAL;
+ {
+ path_flags |= FIB_ROUTE_PATH_LOCAL;
+ if (~0 != next_hop_sw_if_index)
+ {
+ entry_flags |= (FIB_ENTRY_FLAG_CONNECTED | FIB_ENTRY_FLAG_LOCAL);
+ }
+ }
if (is_dvr)
path_flags |= FIB_ROUTE_PATH_DVR;
if (is_resolve_host)
@@ -838,7 +844,8 @@ add_del_route_t_handler (u8 is_multipath,
stats_dslock_with_hint (1 /* release hint */ , 2 /* tag */ );
- if (is_drop || is_local || is_classify || is_unreach || is_prohibit)
+ if (is_drop || (is_local && (~0 == next_hop_sw_if_index)) ||
+ is_classify || is_unreach || is_prohibit)
{
/*
* special route types that link directly to the adj