aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/map
diff options
context:
space:
mode:
authorJean-Mickael Guerin <jean-mickael.guerin@6wind.com>2016-03-04 14:14:21 +0100
committerGerrit Code Review <gerrit@fd.io>2016-03-14 12:40:17 +0000
commit8941ec2cb4ff29dbf167e3b80e09a70c9164cc19 (patch)
tree62e64a2f5e13a2ce6257c102c5f48a074e017716 /vnet/vnet/map
parent966a8b868b33de72d5d9edb6317418165c62661c (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/map')
-rw-r--r--vnet/vnet/map/ip4_sixrd.c4
-rw-r--r--vnet/vnet/map/ip6_sixrd.c4
-rw-r--r--vnet/vnet/map/map.h24
-rw-r--r--vnet/vnet/map/sixrd.h3
4 files changed, 16 insertions, 19 deletions
diff --git a/vnet/vnet/map/ip4_sixrd.c b/vnet/vnet/map/ip4_sixrd.c
index 1e83ce831e0..2fb8015d994 100644
--- a/vnet/vnet/map/ip4_sixrd.c
+++ b/vnet/vnet/map/ip4_sixrd.c
@@ -15,7 +15,7 @@
*/
#include "sixrd.h"
-vlib_node_registration_t ip4_sixrd_node;
+static vlib_node_registration_t ip4_sixrd_node;
typedef enum {
IP4_SIXRD_NEXT_IP6_LOOKUP,
@@ -112,7 +112,7 @@ static char *sixrd_error_strings[] = {
#undef _
};
-VLIB_REGISTER_NODE(ip4_sixrd_node) = {
+VLIB_REGISTER_NODE(ip4_sixrd_node,static) = {
.function = ip4_sixrd,
.name = "ip4-sixrd",
.vector_size = sizeof(u32),
diff --git a/vnet/vnet/map/ip6_sixrd.c b/vnet/vnet/map/ip6_sixrd.c
index 0bd0cf3a303..36f3fab320b 100644
--- a/vnet/vnet/map/ip6_sixrd.c
+++ b/vnet/vnet/map/ip6_sixrd.c
@@ -20,7 +20,7 @@
#include "sixrd.h"
-vlib_node_registration_t ip6_sixrd_node;
+static vlib_node_registration_t ip6_sixrd_node;
typedef enum {
IP6_SIXRD_NEXT_IP4_LOOKUP,
@@ -114,7 +114,7 @@ static char *sixrd_error_strings[] = {
#undef _
};
-VLIB_REGISTER_NODE(ip6_sixrd_node) = {
+VLIB_REGISTER_NODE(ip6_sixrd_node,static) = {
.function = ip6_sixrd,
.name = "ip6-sixrd",
.vector_size = sizeof(u32),
diff --git a/vnet/vnet/map/map.h b/vnet/vnet/map/map.h
index d38d7f47241..a79da2cdabe 100644
--- a/vnet/vnet/map/map.h
+++ b/vnet/vnet/map/map.h
@@ -296,18 +296,18 @@ typedef struct {
map_main_t map_main;
-vlib_node_registration_t ip4_map_node;
-vlib_node_registration_t ip6_map_node;
-
-vlib_node_registration_t ip4_map_t_node;
-vlib_node_registration_t ip4_map_t_fragmented_node;
-vlib_node_registration_t ip4_map_t_tcp_udp_node;
-vlib_node_registration_t ip4_map_t_icmp_node;
-
-vlib_node_registration_t ip6_map_t_node;
-vlib_node_registration_t ip6_map_t_fragmented_node;
-vlib_node_registration_t ip6_map_t_tcp_udp_node;
-vlib_node_registration_t ip6_map_t_icmp_node;
+extern vlib_node_registration_t ip4_map_node;
+extern vlib_node_registration_t ip6_map_node;
+
+extern vlib_node_registration_t ip4_map_t_node;
+extern vlib_node_registration_t ip4_map_t_fragmented_node;
+extern vlib_node_registration_t ip4_map_t_tcp_udp_node;
+extern vlib_node_registration_t ip4_map_t_icmp_node;
+
+extern vlib_node_registration_t ip6_map_t_node;
+extern vlib_node_registration_t ip6_map_t_fragmented_node;
+extern vlib_node_registration_t ip6_map_t_tcp_udp_node;
+extern vlib_node_registration_t ip6_map_t_icmp_node;
/*
* map_get_pfx
diff --git a/vnet/vnet/map/sixrd.h b/vnet/vnet/map/sixrd.h
index d741cb278b5..388ba4d298b 100644
--- a/vnet/vnet/map/sixrd.h
+++ b/vnet/vnet/map/sixrd.h
@@ -18,9 +18,6 @@
#include <vnet/vnet.h>
#include <vnet/ip/ip.h>
-vlib_node_registration_t ip6_sixrd_node;
-vlib_node_registration_t ip4_sixrd_node;
-
int sixrd_create_domain(ip6_address_t *ip6_prefix, u8 ip6_prefix_len,
ip4_address_t *ip4_prefix, u8 ip4_prefix_len,
ip4_address_t *ip4_src, u32 *sixrd_domain_index, u16 mtu);