Increasing the size of the u->cu_selector item by the size of a struct
tc_u32_key (i.e., making the flexible array member sel->keys one element
bigger) is pointless when one doesn't update sel->nkeys or otherwise
records the increased size, so these are effectively memory leaks.
{
struct rtnl_u32 *u;
struct tc_u32_sel *sel;
- int err;
hashmask = htonl(hashmask);
if (!sel)
return -NLE_NOMEM;
- err = nl_data_append(u->cu_selector, NULL, sizeof(struct tc_u32_key));
- if(err < 0)
- return err;
-
- sel = u32_selector(u);
-
sel->hmask = hashmask;
sel->hoff = offset;
return 0;
{
struct rtnl_u32 *u;
struct tc_u32_sel *sel;
- int err;
offmask = ntohs(offmask);
if (!sel)
return -NLE_NOMEM;
- err = nl_data_append(u->cu_selector, NULL, sizeof(struct tc_u32_key));
- if(err < 0)
- return err;
-
- sel = u32_selector(u);
-
sel->offoff = offoff;
sel->offmask = offmask;
sel->offshift = offshift;
{
struct rtnl_u32 *u;
struct tc_u32_sel *sel;
- int err;
if (!(u = (struct rtnl_u32 *) rtnl_tc_data(TC_CAST(cls))))
return -NLE_NOMEM;
if (!sel)
return -NLE_NOMEM;
- err = nl_data_append(u->cu_selector, NULL, sizeof(struct tc_u32_key));
- if(err < 0)
- return err;
-
- sel = u32_selector(u);
-
sel->flags |= TC_U32_TERMINAL;
return 0;
}