Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ip: fix ip zero checksum verification
[vpp.git]
/
src
/
vnet
/
classify
/
classify_api.c
diff --git
a/src/vnet/classify/classify_api.c
b/src/vnet/classify/classify_api.c
index
08defd4
..
03d0429
100644
(file)
--- a/
src/vnet/classify/classify_api.c
+++ b/
src/vnet/classify/classify_api.c
@@
-71,8
+71,6
@@
_(skip_n_vectors) \
_(match_n_vectors) \
_(next_table_index) \
_(miss_next_index) \
_(match_n_vectors) \
_(next_table_index) \
_(miss_next_index) \
-_(current_data_flag) \
-_(current_data_offset) \
_(mask_len)
static void vl_api_classify_add_del_table_t_handler
_(mask_len)
static void vl_api_classify_add_del_table_t_handler
@@
-112,6
+110,9
@@
static void vl_api_classify_add_del_table_t_handler
table_index = ~0;
}
table_index = ~0;
}
+ u8 current_data_flag = mp->current_data_flag;
+ i16 current_data_offset = clib_net_to_host_i16 (mp->current_data_offset);
+
rv = vnet_classify_add_del_table
(cm, mp->mask, nbuckets, memory_size,
skip_n_vectors, match_n_vectors,
rv = vnet_classify_add_del_table
(cm, mp->mask, nbuckets, memory_size,
skip_n_vectors, match_n_vectors,
@@
-125,9
+126,9
@@
out:
if (rv == 0 && mp->is_add)
{
t = pool_elt_at_index (cm->tables, table_index);
if (rv == 0 && mp->is_add)
{
t = pool_elt_at_index (cm->tables, table_index);
- rmp->skip_n_vectors =
ntoh
l(t->skip_n_vectors);
- rmp->match_n_vectors =
ntoh
l(t->match_n_vectors);
- rmp->new_table_index =
ntoh
l(table_index);
+ rmp->skip_n_vectors =
hton
l(t->skip_n_vectors);
+ rmp->match_n_vectors =
hton
l(t->match_n_vectors);
+ rmp->new_table_index =
hton
l(table_index);
}
else
{
}
else
{
@@
-229,12
+230,22
@@
vl_api_policer_classify_dump_t_handler (vl_api_policer_classify_dump_t * mp)
policer_classify_main_t *pcm = &policer_classify_main;
u32 *vec_tbl;
int i;
policer_classify_main_t *pcm = &policer_classify_main;
u32 *vec_tbl;
int i;
+ u32 filter_sw_if_index;
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
- vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
+ filter_sw_if_index = ntohl (mp->sw_if_index);
+ if (filter_sw_if_index
+ >= vec_len (pcm->classify_table_index_by_sw_if_index[mp->type]))
+ return;
+
+ if (filter_sw_if_index != ~0)
+ vec_tbl =
+ &pcm->classify_table_index_by_sw_if_index[mp->type][filter_sw_if_index];
+ else
+ vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
if (vec_len (vec_tbl))
{
if (vec_len (vec_tbl))
{
@@
-505,12
+516,22
@@
vl_api_flow_classify_dump_t_handler (vl_api_flow_classify_dump_t * mp)
flow_classify_main_t *pcm = &flow_classify_main;
u32 *vec_tbl;
int i;
flow_classify_main_t *pcm = &flow_classify_main;
u32 *vec_tbl;
int i;
+ u32 filter_sw_if_index;
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
- vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
+ filter_sw_if_index = ntohl (mp->sw_if_index);
+ if (filter_sw_if_index
+ >= vec_len (pcm->classify_table_index_by_sw_if_index[mp->type]))
+ return;
+
+ if (filter_sw_if_index != ~0)
+ vec_tbl =
+ &pcm->classify_table_index_by_sw_if_index[mp->type][filter_sw_if_index];
+ else
+ vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
if (vec_len (vec_tbl))
{
if (vec_len (vec_tbl))
{
@@
-638,7
+659,7
@@
static void vl_api_output_acl_set_interface_t_handler
/*
* classify_api_hookup
* Add vpe's API message handlers to the table.
/*
* classify_api_hookup
* Add vpe's API message handlers to the table.
- * vlib has alread mapped shared memory and
+ * vlib has alread
y
mapped shared memory and
* added the client registration handlers.
* See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
*/
* added the client registration handlers.
* See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
*/
@@
-657,7
+678,7
@@
setup_message_id_table (api_main_t * am)
static clib_error_t *
classify_api_hookup (vlib_main_t * vm)
{
static clib_error_t *
classify_api_hookup (vlib_main_t * vm)
{
- api_main_t *am =
&api_main
;
+ api_main_t *am =
vlibapi_get_main ()
;
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \
#define _(N,n) \
vl_msg_api_set_handlers(VL_API_##N, #n, \