• Pablo Neira Ayuso's avatar
    netfilter: nft_rbtree: allow adjacent intervals with dynamic updates · e701001e
    Pablo Neira Ayuso authored
    This patch fixes dynamic element updates for adjacent intervals in the
    rb-tree representation.
    
    Since elements are sorted in the rb-tree, in case of adjacent nodes with
    the same key, the assumption is that an interval end node must be placed
    before an interval opening.
    
    In tree lookup operations, the idea is to search for the closer element
    that is smaller than the one we're searching for. Given that we'll have
    two possible matchings, we have to take the opening interval in case of
    adjacent nodes.
    
    Range merges are not trivial with the current representation,
    specifically we have to check if node extensions are equal and make sure
    we keep the existing internal states around.
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    e701001e
nft_rbtree.c 7.74 KB