VPP-31 Fix linker issue with new sr-replicate 46/946/6
authorChris Luke <chrisy@flirble.org>
Mon, 2 May 2016 20:00:43 +0000 (16:00 -0400)
committerDamjan Marion <damarion@cisco.com>
Mon, 2 May 2016 22:03:07 +0000 (22:03 +0000)
Changes in gnu ld in Ubuntu 16.04 tickles an issue with the
declaration pattern used for vlib_node_registration when,
as is the case in sr_replicate.c, the forward declaration is
seen by the linker in a module before the real declaration.

This patch uses the "extern" keyword in the forward declaration
to avoid this issue and removes extra forward declarations.

Change-Id: I075b0cd9932404e1360c7f9aec7114003d110f60
Signed-off-by: Chris Luke <chrisy@flirble.org>
vnet/vnet/sr/sr.h
vnet/vnet/sr/sr_replicate.c

index 321f49a..448d293 100644 (file)
@@ -188,7 +188,7 @@ format_function_t format_ip6_sr_header_with_length;
 vlib_node_registration_t ip6_sr_input_node;
 
 #if DPDK > 0
-vlib_node_registration_t sr_replicate_node;
+extern vlib_node_registration_t sr_replicate_node;
 #endif /* DPDK */
 
 int ip6_sr_add_del_tunnel (ip6_sr_add_del_tunnel_args_t * a);
index 7486d7c..80d04ba 100644 (file)
@@ -36,8 +36,6 @@ typedef struct {
 
 sr_replicate_main_t sr_replicate_main;
 
-vlib_node_registration_t sr_replicate_node;
-
 
 typedef struct {
   ip6_address_t src, dst;
@@ -76,8 +74,6 @@ static u8 * format_sr_replicate_trace (u8 * s, va_list * args)
 
 }
 
-vlib_node_registration_t sr_replicate_node;
-
 #define foreach_sr_replicate_error \
 _(REPLICATED, "sr packets replicated") \
 _(NO_BUFFERS, "error allocating buffers for replicas") \