X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=flowspec-xdp;a=blobdiff_plain;f=genrules.py;h=480e628dca23574ccffb8e28095bf6cda662770e;hp=4468c1e00e52d58fb12c9d4769ae12c95c7d2704;hb=891dade88d85923a278d2e2ebc2c4ce615263204;hpb=d4d0eb34912fd66bf9eb73d98ed57fd3def3336a diff --git a/genrules.py b/genrules.py index 4468c1e..480e628 100755 --- a/genrules.py +++ b/genrules.py @@ -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" :