Statically store up to 32 locations per command, if the number of
locations is larger than 32, then skip rather than hit assertion.
Revisit this later to dynamically store location per command using a
hashtable.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
struct monitor *monitor_alloc(uint32_t format, uint32_t type, const char *event);
void monitor_free(struct monitor *m);
-#define NFT_NLATTR_LOC_MAX 8
+#define NFT_NLATTR_LOC_MAX 32
/**
* struct cmd - command statement
void cmd_add_loc(struct cmd *cmd, uint16_t offset, struct location *loc)
{
- assert(cmd->num_attrs < NFT_NLATTR_LOC_MAX);
+ if (cmd->num_attrs > NFT_NLATTR_LOC_MAX)
+ return;
+
cmd->attr[cmd->num_attrs].offset = offset;
cmd->attr[cmd->num_attrs].location = loc;
cmd->num_attrs++;