do_flowvec_ioctl() was checking for too-big 'n_flows' but not negative
'n_flows'. We could add that check too, but 'n_flows' should never be
negative so it's better to just use an unsigned type.
static int query_flows(struct datapath *dp, const struct odp_flowvec *flowvec)
{
struct tbl *table = rcu_dereference(dp->table);
- int i;
+ u32 i;
+
for (i = 0; i < flowvec->n_flows; i++) {
struct __user odp_flow *ufp = &flowvec->flows[i];
struct odp_flow uf;
struct list_flows_cbdata {
struct odp_flow __user *uflows;
- int n_flows;
- int listed_flows;
+ u32 n_flows;
+ u32 listed_flows;
};
static int list_flow(struct tbl_node *node, void *cbdata_)
struct odp_flowvec {
struct odp_flow *flows;
- int n_flows;
+ __u32 n_flows;
};
/* The VLAN id is 12 bits, so we can use the entire 16 bits to indicate