]> git.bitcoin.ninja Git - flowspec-xdp/commitdiff
COrrect daddr gt handling in RuleNode::__lt__
authorMatt Corallo <git@bluematt.me>
Mon, 17 Jun 2024 05:34:43 +0000 (05:34 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 17 Jun 2024 05:34:43 +0000 (05:34 +0000)
genrules.py

index 1e9c978738e4e0976e6d68d98f215575fe288b43..647152aaa847576d3be781ae36cb8cdb409edb02 100755 (executable)
@@ -348,9 +348,9 @@ class RuleNode:
             elif selfsrc is not None and othersrc is not None:
                 o = selfsrc.ord(othersrc)
 
-        if o == ORD_LESS:
-            return True
-        return [a for a in self.action if type(a) != IpRule] < [b for b in other.action if type(b) != IpRule]
+        if o == ORD_EQUAL:
+            return [a for a in self.action if type(a) != IpRule] < [b for b in other.action if type(b) != IpRule]
+        return o == ORD_LESS
 
     def maybe_join(self, neighbor):
         if self.ty == RuleAction.CONDITIONS and neighbor.ty == RuleAction.CONDITIONS: