Simplify and (correctly) test DSCP matches
[flowspec-xdp] / genrules.py
index 4468c1e00e52d58fb12c9d4769ae12c95c7d2704..480e628dca23574ccffb8e28095bf6cda662770e 100755 (executable)
@@ -227,7 +227,7 @@ def dscp_to_rule(proto, rules):
     if proto == 4:
         return "if (!( " + ast.write("((ip->tos & 0xfc) >> 2)") + " )) break;"
     else:
-        return "if (!( " + ast.write("((ip6->priority << 4) | ((ip6->flow_lbl[0] & 0xc0) >> 4) >> 2)") + " )) break;"
+        return "if (!( " + ast.write("((ip6->priority << 2) | ((ip6->flow_lbl[0] & 0xc0) >> 6))") + " )) break;"
 
 def port_to_rule(ty, rules):
     if ty == "port" :