]> git.ipfire.org Git - thirdparty/nftables.git/commit
segtree: Fix for last elem at interval end
authorPhil Sutter <phil@nwl.cc>
Fri, 13 Apr 2018 14:52:29 +0000 (16:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 14 Apr 2018 11:53:02 +0000 (13:53 +0200)
commit2f97139ceab4b677c912fb96106400048ad57f0a
tree9f892ee11af009b1910700246e7c8576253e57ba
parentebc3f6636bd5a3c54350d9ed06c1785cb6cc37be
segtree: Fix for last elem at interval end

Unclosed interval check at end of interval_map_decompose() missed to
check whether interval start is the last possible element in given set
before creating a range expression. This led to the last element
incorrectly printed as range from itself to itself. Fix this by
comparing the upper boundary against the lower one.

In order to keep indenting level low, invert the entry check and jump to
the end if it matches.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/segtree.c
tests/py/ip6/srh.t