]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
segtree: Fix missing expires value in prefixes
authorPhil Sutter <phil@nwl.cc>
Tue, 28 Apr 2020 18:54:03 +0000 (20:54 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 4 May 2020 14:21:06 +0000 (16:21 +0200)
This probable copy'n'paste bug prevented 'expiration' field from being
populated when turning a range into a prefix in
interval_map_decompose(). Consequently, interval sets with timeout did
print expiry value for ranges (such as 10.0.0.1-10.0.0.5) but not
prefixes (10.0.0.0/8, for instance).

Fixes: bb0e6d8a2851b ("segtree: incorrect handling of comments and timeouts with mapping")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/segtree.c

index a9d6ecc89d7c17c5e4323d71ec45db80958d0449..002ee41a16db09ce526148c10019bca0cc4b38a6 100644 (file)
@@ -1099,7 +1099,7 @@ void interval_map_decompose(struct expr *set)
                                        prefix->comment = xstrdup(low->comment);
                                if (low->timeout)
                                        prefix->timeout = low->timeout;
-                               if (low->left->expiration)
+                               if (low->expiration)
                                        prefix->expiration = low->expiration;
                        }