diff options
author | Andrew Yourtchenko <ayourtch@gmail.com> | 2017-10-25 05:50:37 -0700 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2017-10-25 16:28:03 +0000 |
commit | 5f3fcb96296a4769f55f60270e10c6294c604db9 (patch) | |
tree | 028293ba04f669187b8d41cd72f34f195e12e81b /src/vnet/fib | |
parent | 36ea2d6d3a67a60534a7c2b58551688858a1ce7f (diff) |
L3 proxy FIB source for container networking
Change-Id: I4164c4c19c8dbfd73e6ddf94a12056325cc093b9
Signed-off-by: Neale Ranns <nranns@cisco.com>
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/vnet/fib')
-rw-r--r-- | src/vnet/fib/fib_entry.h | 5 | ||||
-rw-r--r-- | src/vnet/fib/fib_entry_src_special.c | 1 | ||||
-rw-r--r-- | src/vnet/fib/fib_path.c | 15 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/vnet/fib/fib_entry.h b/src/vnet/fib/fib_entry.h index 2f6e37fe69a..7e4b52acffd 100644 --- a/src/vnet/fib/fib_entry.h +++ b/src/vnet/fib/fib_entry.h @@ -43,6 +43,10 @@ typedef enum fib_source_t_ { */ FIB_SOURCE_CLASSIFY, /** + * A route the is being 'proxied' on behalf of another device + */ + FIB_SOURCE_PROXY, + /** * Route added as a result of interface configuration. * this will also come from the API/CLI, but the distinction is * that is from confiiguration on an interface, not a 'ip route' command @@ -136,6 +140,7 @@ STATIC_ASSERT (sizeof(fib_source_t) == 1, #define FIB_SOURCES { \ [FIB_SOURCE_SPECIAL] = "special", \ [FIB_SOURCE_INTERFACE] = "interface", \ + [FIB_SOURCE_PROXY] = "proxy", \ [FIB_SOURCE_API] = "API", \ [FIB_SOURCE_CLI] = "CLI", \ [FIB_SOURCE_ADJ] = "adjacency", \ diff --git a/src/vnet/fib/fib_entry_src_special.c b/src/vnet/fib/fib_entry_src_special.c index e979e18f680..c3e4fe5eba7 100644 --- a/src/vnet/fib/fib_entry_src_special.c +++ b/src/vnet/fib/fib_entry_src_special.c @@ -67,4 +67,5 @@ fib_entry_src_special_register (void) fib_entry_src_register(FIB_SOURCE_SIXRD, &special_src_vft); fib_entry_src_register(FIB_SOURCE_CLASSIFY, &special_src_vft); fib_entry_src_register(FIB_SOURCE_AE, &special_src_vft); + fib_entry_src_register(FIB_SOURCE_PROXY, &special_src_vft); } diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c index 7b713a4b5c5..926b2f3dfc6 100644 --- a/src/vnet/fib/fib_path.c +++ b/src/vnet/fib/fib_path.c @@ -1854,20 +1854,21 @@ fib_path_contribute_urpf (fib_node_index_t path_index, case FIB_PATH_TYPE_EXCLUSIVE: case FIB_PATH_TYPE_SPECIAL: - /* + { + /* * these path types may link to an adj, if that's what * the clinet gave */ - if (dpo_is_adj(&path->fp_dpo)) - { - ip_adjacency_t *adj; + u32 rpf_sw_if_index; - adj = adj_get(path->fp_dpo.dpoi_index); + rpf_sw_if_index = dpo_get_urpf(&path->fp_dpo); - fib_urpf_list_append(urpf, adj->rewrite_header.sw_if_index); + if (~0 != rpf_sw_if_index) + { + fib_urpf_list_append(urpf, rpf_sw_if_index); } break; - + } case FIB_PATH_TYPE_DEAG: case FIB_PATH_TYPE_RECEIVE: case FIB_PATH_TYPE_INTF_RX: |