diff options
author | Jean-Mickael Guerin <jean-mickael.guerin@6wind.com> | 2016-03-04 14:14:21 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-03-14 12:40:17 +0000 |
commit | 8941ec2cb4ff29dbf167e3b80e09a70c9164cc19 (patch) | |
tree | 62e64a2f5e13a2ce6257c102c5f48a074e017716 /vnet/vnet/ipsec/ipsec_input.c | |
parent | 966a8b868b33de72d5d9edb6317418165c62661c (diff) |
fix declaration of symbol of different size
I got many warnings at the link step with gcc version 5.3.1 20160225 (Ubuntu 5.3.1-10ubuntu2):
/usr/bin/ld: Warning: size of symbol `cop_input_node' changed from 112 in vnet/cop/.libs/cop.o to 168 in vnet/cop/.libs/node1.o
/usr/bin/ld: Warning: size of symbol `ethernet_input_node' changed from 112 in vnet/.libs/interface.o to 136 in vnet/ethernet/.libs/node.o
/usr/bin/ld: Warning: size of symbol `l2output_node' changed from 112 in vnet/l2/.libs/l2_efp_filter.o to 120 in vnet/l2/.libs/l2_output.o
/usr/bin/ld: Warning: size of symbol `srp_input_node' changed from 112 in vnet/srp/.libs/format.o to 136 in vnet/srp/.libs/node.o
/usr/bin/ld: Warning: size of symbol `vxlan_encap_node' changed from 112 in vnet/vxlan/.libs/vxlan.o to 128 in vnet/vxlan/.libs/encap.o
/usr/bin/ld: Warning: size of symbol `vxlan_input_node' changed from 112 in vnet/vxlan/.libs/vxlan.o to 144 in vnet/vxlan/.libs/decap.o
...
Looking at vlib_node_registration_t, I think the reason is that
the char * next_nodes[] could be bigger where the variable is defined
in .c file.
We should mark global variables as external in header files.
Some of them can be made static.
Change-Id: Ieb6961fd08180c9a69e1d884852703f3eb23f23f
Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Diffstat (limited to 'vnet/vnet/ipsec/ipsec_input.c')
-rw-r--r-- | vnet/vnet/ipsec/ipsec_input.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vnet/vnet/ipsec/ipsec_input.c b/vnet/vnet/ipsec/ipsec_input.c index abb4a47485a..3cd60ba1fe9 100644 --- a/vnet/vnet/ipsec/ipsec_input.c +++ b/vnet/vnet/ipsec/ipsec_input.c @@ -52,8 +52,6 @@ static char * ipsec_input_error_strings[] = { #undef _ }; -vlib_node_registration_t ipsec_input_node; - typedef struct { u32 tunnel_index; u32 spi; @@ -172,6 +170,8 @@ ipsec_input_ip6_protect_policy_match (ipsec_spd_t * spd, return 0; } +static vlib_node_registration_t ipsec_input_ip4_node; + static uword ipsec_input_ip4_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, @@ -270,7 +270,7 @@ trace0: } -VLIB_REGISTER_NODE (ipsec_input_ip4_node) = { +VLIB_REGISTER_NODE (ipsec_input_ip4_node,static) = { .function = ipsec_input_ip4_node_fn, .name = "ipsec-input-ip4", .vector_size = sizeof (u32), @@ -289,6 +289,8 @@ VLIB_REGISTER_NODE (ipsec_input_ip4_node) = { }; +static vlib_node_registration_t ipsec_input_ip6_node; + static uword ipsec_input_ip6_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, @@ -387,7 +389,7 @@ trace0: } -VLIB_REGISTER_NODE (ipsec_input_ip6_node) = { +VLIB_REGISTER_NODE (ipsec_input_ip6_node,static) = { .function = ipsec_input_ip6_node_fn, .name = "ipsec-input-ip6", .vector_size = sizeof (u32), |