summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-03-06 16:26:09 +0100
committerPatrick McHardy <kaber@trash.net>2014-03-07 10:20:14 +0100
commitcbeb5df0a202f07e84db32d4015026b3d3f3c892 (patch)
tree450bcdc271627d6a7238edc7f5d79cfb41c564e2 /src/rule.c
parent7663afee1685272777d74b6c6117b71ae06bec95 (diff)
set: abort on interval conflicts
We currently print a debug message (with debugging) and continue. Output a proper error message and abort. While at it, make sure we only report a conflict if there actually is one. This is not the case similar actions, IOW in case of sets, never, in case of maps, only if the mapping differs. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rule.c b/src/rule.c
index 0e04282e..b7190401 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -498,8 +498,9 @@ static int do_add_set(struct netlink_ctx *ctx, const struct handle *h,
if (netlink_add_set(ctx, h, set) < 0)
return -1;
if (set->init != NULL) {
- if (set->flags & SET_F_INTERVAL)
- set_to_intervals(set);
+ if (set->flags & SET_F_INTERVAL &&
+ set_to_intervals(ctx->msgs, set) < 0)
+ return -1;
if (do_add_setelems(ctx, &set->handle, set->init) < 0)
return -1;
}