summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-arp.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2013-10-03 12:52:55 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-30 23:50:49 +0100
commit0363995ef12c2377875f9ab60a43b9b601cb2560 (patch)
tree5a0a88619dc0c424cfa8dfe73a0b3ebd541d7909 /iptables/xtables-arp.c
parentd6a127cd5710f8c60e95bfd0378ca352c07140a9 (diff)
xtables: arp: Store target entry properly and compare them relevantly
Fixes a segfault issue when deleting a rule. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-arp.c')
-rw-r--r--iptables/xtables-arp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c
index 407fb066..8072d90d 100644
--- a/iptables/xtables-arp.c
+++ b/iptables/xtables-arp.c
@@ -819,12 +819,12 @@ generate_entry(const struct arpt_entry *fw,
size = sizeof(struct arpt_entry);
- e = xtables_malloc(size + target->u.target_size);
+ e = xtables_malloc(size);
*e = *fw;
- e->target_offset = size;
- e->next_offset = size + target->u.target_size;
+ e->target_offset = offsetof(struct arpt_entry, elems);
+ e->next_offset = e->target_offset + target->u.target_size;
- t = (void *) e + e->target_offset;
+ t = (void *) &e->elems;
*t = target;
return e;