diff options
author | Phil Sutter <phil@nwl.cc> | 2018-05-09 16:03:41 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-05-09 18:29:21 +0200 |
commit | 5a7775a1d699ced8a0c760d4849c4e84bac9268a (patch) | |
tree | e5107a3ba9425764878f59ed4bc457aded6cf04c /src | |
parent | effb881c9cef28aca47adeec5014e0457507539e (diff) |
rule: Copy locations in handle_merge()
This allows to make error messages point to the right part of the
command after handles were merged.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/rule.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -40,12 +40,18 @@ void handle_merge(struct handle *dst, const struct handle *src) { if (dst->family == 0) dst->family = src->family; - if (dst->table.name == NULL && src->table.name != NULL) + if (dst->table.name == NULL && src->table.name != NULL) { dst->table.name = xstrdup(src->table.name); - if (dst->chain.name == NULL && src->chain.name != NULL) + dst->table.location = src->table.location; + } + if (dst->chain.name == NULL && src->chain.name != NULL) { dst->chain.name = xstrdup(src->chain.name); - if (dst->set.name == NULL && src->set.name != NULL) + dst->chain.location = src->chain.location; + } + if (dst->set.name == NULL && src->set.name != NULL) { dst->set.name = xstrdup(src->set.name); + dst->set.location = src->set.location; + } if (dst->flowtable == NULL && src->flowtable != NULL) dst->flowtable = xstrdup(src->flowtable); if (dst->obj.name == NULL && src->obj.name != NULL) |