connmark: Compare the complete rules when deleting them

By settings a matchmask that covers the complete rule we ensure that the
correct rule is deleted (i.e. matches and targets with potentially different
marks are also compared).

Since data after the passed pointer is actually dereferenced when
comparing we definitely have to pass an array that is at least as long as
the ipt_entry.

Fixes #1229.
This commit is contained in:
Tobias Brunner
2016-03-10 17:26:09 +01:00
parent 6b8acc49ed
commit 7c9e7eb933
@@ -101,7 +101,10 @@ static bool manage_rule(struct iptc_handle *ipth, const char *chain,
}
else
{
if (!iptc_delete_entry(chain, e, "", ipth))
u_char matchmask[e->next_offset];
memset(matchmask, 255, sizeof(matchmask));
if (!iptc_delete_entry(chain, e, matchmask, ipth))
{
DBG1(DBG_CFG, "deleting %s rule failed: %s",
chain, iptc_strerror(errno));