X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_flow_classify%2Frte_flow_classify.c;h=5ff585803b5e51d45688ff848570f61e5de1cc0d;hb=5d6d7e443deab3ed2272940499e246629c737377;hp=6fa6a74bed38236c0383a11990f554cacfc21068;hpb=ffb9fd1b0808e50ee5c9e27c95c5b2c30e06b2cf;p=dpdk.git diff --git a/lib/librte_flow_classify/rte_flow_classify.c b/lib/librte_flow_classify/rte_flow_classify.c index 6fa6a74bed..5ff585803b 100644 --- a/lib/librte_flow_classify/rte_flow_classify.c +++ b/lib/librte_flow_classify/rte_flow_classify.c @@ -2,6 +2,8 @@ * Copyright(c) 2017 Intel Corporation */ +#include +#include #include #include "rte_flow_classify_parse.h" #include @@ -246,8 +248,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params) } /* socket */ - if ((params->socket_id < 0) || - (params->socket_id >= RTE_MAX_NUMA_NODES)) { + if (params->socket_id < 0) { RTE_FLOW_CLASSIFY_LOG(ERR, "%s: Incorrect value for parameter socket_id\n", __func__); @@ -285,8 +286,7 @@ rte_flow_classifier_create(struct rte_flow_classifier_params *params) } /* Save input parameters */ - snprintf(cls->name, RTE_FLOW_CLASSIFIER_MAX_NAME_SZ, "%s", - params->name); + strlcpy(cls->name, params->name, RTE_FLOW_CLASSIFIER_MAX_NAME_SZ); cls->socket_id = params->socket_id; @@ -560,6 +560,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls, return rule; } } + free(rule); return NULL; } @@ -633,9 +634,7 @@ action_apply(struct rte_flow_classifier *cls, } if (count) { ret = 0; - ntuple_stats = - (struct rte_flow_classify_ipv4_5tuple_stats *) - stats->stats; + ntuple_stats = stats->stats; ntuple_stats->counter1 = count; ntuple_stats->ipv4_5tuple = rule->rules.u.ipv4_5tuple; } @@ -673,10 +672,7 @@ rte_flow_classifier_query(struct rte_flow_classifier *cls, return ret; } -RTE_INIT(librte_flow_classify_init_log); - -static void -librte_flow_classify_init_log(void) +RTE_INIT(librte_flow_classify_init_log) { librte_flow_classify_logtype = rte_log_register("lib.flow_classify");