From 98b9571f6720a0da06b1d430e7338a0734023232 Mon Sep 17 00:00:00 2001 From: Vishwesh M Rudramuni Date: Mon, 25 Sep 2017 03:36:02 +0530 Subject: REST_API: rest api client implementation JIRA: SAMPLEVNF-78 This patch implements rest api's for VNF clients. This comprises of * vnf api's for common functionality * vnf api's for CGNAPT * vnf api's for VFW Change-Id: I56d22c64bf3ee5b0a2e536da8169ac7583499041 Signed-off-by: Vishwesh M Rudramuni --- common/VIL/l2l3_stack/lib_arp.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'common/VIL/l2l3_stack/lib_arp.c') diff --git a/common/VIL/l2l3_stack/lib_arp.c b/common/VIL/l2l3_stack/lib_arp.c index e2f755f2..b8976d3a 100644 --- a/common/VIL/l2l3_stack/lib_arp.c +++ b/common/VIL/l2l3_stack/lib_arp.c @@ -71,7 +71,7 @@ uint32_t nd_buffer = ARP_BUF_DEFAULT; #define IN6ADDRSZ 16 #define MAX_PORTS 32 -static int my_inet_pton_ipv6(int af, const char *src, void *dst); +int my_inet_pton_ipv6(int af, const char *src, void *dst); static int inet_pton_ipv6(const char *src, unsigned char *dst); static int inet_pton_ipv4(const char *src, unsigned char *dst); static void local_arp_cache_init(void); @@ -983,10 +983,13 @@ void remove_arp_entry(struct arp_entry_data *ret_arp_data, void *arg) struct arp_timer_key *arp_key = (struct arp_timer_key *)arg; lib_arp_delete_called++; - rte_timer_stop(ret_arp_data->timer); - rte_free(ret_arp_data->timer_key); - rte_free(ret_arp_data->buf_pkts); - ret_arp_data->buf_pkts = NULL; + if (ret_arp_data->timer) { + rte_timer_stop(ret_arp_data->timer); + rte_free(ret_arp_data->timer_key); + rte_free(ret_arp_data->buf_pkts); + ret_arp_data->buf_pkts = NULL; + } + if (ARPICMP_DEBUG) { RTE_LOG(INFO, LIBARP, "ARP Entry Deleted for IP :%d.%d.%d.%d , port %d\n", @@ -1164,7 +1167,7 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr, if (new_arp_data->status == STALE) { new_arp_data->status = PROBE; if (ifm_chk_port_ipv4_enabled - (new_arp_data->port)) { + (new_arp_data->port) != IFM_FAILURE) { request_arp(new_arp_data->port, new_arp_data->ip); } else { @@ -1894,7 +1897,7 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) * author: * Paul Vixie, 1996. */ -static int my_inet_pton_ipv6(int af, const char *src, void *dst) +int my_inet_pton_ipv6(int af, const char *src, void *dst) { switch (af) { case AF_INET: @@ -2618,7 +2621,7 @@ void arp_timer_callback(struct rte_timer *timer, void *arg) } if (ifm_chk_port_ipv4_enabled - (ret_arp_data->port)) { + (ret_arp_data->port) != IFM_FAILURE) { request_arp(ret_arp_data->port, ret_arp_data->ip); } else { -- cgit 1.2.3-korg