From 2828efcfb96be56f0ef894e2df1e309670a2283a Mon Sep 17 00:00:00 2001 From: Michael Qiu Date: Thu, 7 Jul 2016 11:28:27 +0800 Subject: plugin/vcgn:Remove local defined ip4_interface_first_address Function ip4_interface_first_address has been defined in vnet/ip/ip4.h, and result an compile issue. CC vcgn/cnat_ipv4_icmp_error_outside_input.lo CC vcgn/cnat_logging.lo vcgn/cnat_logging.c:361:1: error: conflicting types for 'ip4_interface_first_address' ip4_interface_first_address (ip4_main_t * im, u32 sw_if_index) ^ In file included from /usr/include/vnet/ip/ip.h:57:0, from vcgn/cnat_logging.c:24: /usr/include/vnet/ip/ip4.h:390:1: note: previous declaration of 'ip4_interface_first_address' was here ip4_interface_first_address (ip4_main_t * im, u32 sw_if_index, ^ make: *** [vcgn/cnat_logging.lo] Error 1 Change-Id: I1165c9bb778263c195ed34ab438dcb27dfd207bc Signed-off-by: Michael Qiu --- plugins/vcgn-plugin/vcgn/cnat_logging.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'plugins') diff --git a/plugins/vcgn-plugin/vcgn/cnat_logging.c b/plugins/vcgn-plugin/vcgn/cnat_logging.c index 50805d11..71f156a9 100644 --- a/plugins/vcgn-plugin/vcgn/cnat_logging.c +++ b/plugins/vcgn-plugin/vcgn/cnat_logging.c @@ -356,24 +356,6 @@ u16 cnat_nfv9_pad_end_of_record_length (u16 record_length) return ((record_length + pad_value) & (~pad_value)); } -/* get first interface address */ -static ip4_address_t * -ip4_interface_first_address (ip4_main_t * im, u32 sw_if_index) -{ - ip_lookup_main_t * lm = &im->lookup_main; - ip_interface_address_t * ia = 0; - ip4_address_t * result = 0; - - foreach_ip_interface_address (lm, ia, sw_if_index, - 1 /* honor unnumbered */, - ({ - ip4_address_t * a = ip_interface_address_get_address (lm, ia); - result = a; - break; - })); - return result; -} - void fill_ip_n_udp_hdr (u32 ipv4_addr, u16 port, cnat_nfv9_logging_info_t *nfv9_logging_info) { @@ -403,7 +385,7 @@ void fill_ip_n_udp_hdr (u32 ipv4_addr, u16 port, ip_header->dest_addr = clib_host_to_net_u32(ipv4_addr); ip_length = vlib_buffer_length_in_chain (vm, b0); ip_header->total_len_bytes = clib_host_to_net_u16(pkt_len); - ia0 = ip4_interface_first_address(&ip4_main, nfv9_logging_info->i_vrf_id); + ia0 = ip4_interface_first_address(&ip4_main, nfv9_logging_info->i_vrf_id, 0); ip_header->src_addr = ia0->as_u32; udp_header->src_port = clib_host_to_net_u16(src_port); udp_header->dest_port = clib_host_to_net_u16(port); -- cgit 1.2.3-korg