diff options
author | Dave Barach <dave@barachs.net> | 2016-02-24 11:29:06 -0500 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2016-02-24 11:30:44 -0500 |
commit | 1f49ed666af8b9cb889f9ea61f084341d0b6c4f4 (patch) | |
tree | 0e951e3cc6a21f7320084a6b5f0e213f1852b634 /vnet/vnet/ethernet/node.c | |
parent | 9f50b0b5b12c0e1b01f36cf84070549911197584 (diff) |
Link the vpp application against libvnet.so, not libvnet.a
Turn of srp, mainly as an example of how to restructure a featurette
for selective disablement.
Change-Id: Id3364c58a8711b103939f4434adfa67177380f67
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet/vnet/ethernet/node.c')
-rw-r--r-- | vnet/vnet/ethernet/node.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vnet/vnet/ethernet/node.c b/vnet/vnet/ethernet/node.c index 9c943992b68..9aed302f407 100644 --- a/vnet/vnet/ethernet/node.c +++ b/vnet/vnet/ethernet/node.c @@ -960,6 +960,16 @@ clib_error_t * next_by_ethertype_init (next_by_ethertype_t * l3_next) l3_next->sparse_index_by_input_next_index[ETHERNET_INPUT_NEXT_PUNT] = SPARSE_VEC_INVALID_INDEX; + /* + * Make sure we don't wipe out an ethernet registration by mistake + * Can happen if init function ordering constraints are missing. + */ + if (CLIB_DEBUG > 0) + { + ethernet_main_t * em = ðernet_main; + ASSERT(em->next_by_ethertype_register_called == 0); + } + return 0; } @@ -972,6 +982,12 @@ clib_error_t * next_by_ethertype_register (next_by_ethertype_t * l3_next, u16 * n; ethernet_main_t * em = ðernet_main; + if (CLIB_DEBUG > 0) + { + ethernet_main_t * em = ðernet_main; + em->next_by_ethertype_register_called = 1; + } + /* Setup ethernet type -> next index sparse vector mapping. */ n = sparse_vec_validate (l3_next->input_next_by_type, ethertype); n[0] = next_index; |