diff options
Diffstat (limited to 'iptables.c')
-rw-r--r-- | iptables.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -805,7 +805,8 @@ insert_entry(const ipt_chainlabel chain, } static unsigned char * -make_delete_mask(struct xtables_rule_match *matches) +make_delete_mask(struct xtables_rule_match *matches, + const struct xtables_target *target) { /* Establish mask for comparison */ unsigned int size; @@ -818,7 +819,7 @@ make_delete_mask(struct xtables_rule_match *matches) mask = xtables_calloc(1, size + IPT_ALIGN(sizeof(struct ipt_entry_target)) - + xtables_targets->size); + + target->size); memset(mask, 0xFF, sizeof(struct ipt_entry)); mptr = mask + sizeof(struct ipt_entry); @@ -832,7 +833,7 @@ make_delete_mask(struct xtables_rule_match *matches) memset(mptr, 0xFF, IPT_ALIGN(sizeof(struct ipt_entry_target)) - + xtables_targets->userspacesize); + + target->userspacesize); return mask; } @@ -848,13 +849,14 @@ delete_entry(const ipt_chainlabel chain, const struct in_addr dmasks[], int verbose, struct iptc_handle *handle, - struct xtables_rule_match *matches) + struct xtables_rule_match *matches, + const struct xtables_target *target) { unsigned int i, j; int ret = 1; unsigned char *mask; - mask = make_delete_mask(matches); + mask = make_delete_mask(matches, target); for (i = 0; i < nsaddrs; i++) { fw->ip.src.s_addr = saddrs[i].s_addr; fw->ip.smsk.s_addr = smasks[i].s_addr; @@ -1979,7 +1981,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle nsaddrs, saddrs, smasks, ndaddrs, daddrs, dmasks, options&OPT_VERBOSE, - *handle, matches); + *handle, matches, target); break; case CMD_DELETE_NUM: ret = iptc_delete_num_entry(chain, rulenum - 1, *handle); |