From 2280f91c9c4a2261f44e19dadb4f450ef6c92e77 Mon Sep 17 00:00:00 2001 From: Vishwesh M Rudramuni Date: Thu, 5 Oct 2017 03:37:35 +0530 Subject: common code: KW fixes for common code This patch fixes KW issues seen with the common code. Change-Id: I4f90369152345ea2ea9316b04ac946c0c69fd7d1 Signed-off-by: Vishwesh M Rudramuni --- common/VIL/pipeline_arpicmp/pipeline_arpicmp.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'common/VIL/pipeline_arpicmp/pipeline_arpicmp.c') diff --git a/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c b/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c index 607d13d1..847e2936 100644 --- a/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c +++ b/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c @@ -70,10 +70,10 @@ struct cmd_arp_add_result { }; -uint16_t str2flowtype(char *string); +uint16_t str2flowtype(const char *string); int parse_flexbytes(const char *q_arg, uint8_t *flexbytes, uint16_t max_num); -enum rte_eth_input_set_field str2inset(char *string); +enum rte_eth_input_set_field str2inset(const char *string); int app_pipeline_arpicmp_entry_dbg(struct app_params *app, uint32_t pipeline_id, uint8_t *msg); @@ -168,6 +168,11 @@ cmd_arp_del_parsed(void *parsed_result, arp_key.filler2 = 0; arp_key.filler3 = 0; struct arp_entry_data *new_arp_data = retrieve_arp_entry(arp_key, STATIC_ARP); + if(new_arp_data == NULL) { + /* KW Fix */ + printf("Retrieve arp returned NULL\n"); + return; + } remove_arp_entry(new_arp_data, &arp_key); } else { struct nd_key_ipv6 nd_key; @@ -177,6 +182,11 @@ cmd_arp_del_parsed(void *parsed_result, nd_key.filler2 = 0; nd_key.filler3 = 0; struct nd_entry_data *new_nd_data = retrieve_nd_entry(nd_key, STATIC_ND); + if(new_nd_data == NULL) { + /* KW Fix */ + printf("Retrieve ND returned NULL\n"); + return; + } remove_nd_entry_ipv6(new_nd_data, &nd_key); } } @@ -960,7 +970,7 @@ cmdline_parse_inst_t cmd_set_fwd_mode = { #if 1 -uint16_t str2flowtype(char *string) +uint16_t str2flowtype(const char *string) { uint8_t i = 0; static const struct { @@ -1450,7 +1460,7 @@ struct cmd_set_hash_input_set_result { }; enum rte_eth_input_set_field -str2inset(char *string) +str2inset(const char *string) { uint16_t i; -- cgit 1.2.3-korg