[nft PATCH 2/4] rule: Copy locations in handle_merge()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows to make error messages point to the right part of the
command after handles were merged.

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 src/rule.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/rule.c b/src/rule.c
index 2f0123b7a4a58..f0c6048cc0479 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -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)
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux