projects
/
flowspec-xdp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use BPF_F_NO_COMMON_LRU on BPF_MAP_TYPE_LRU_PERCPU_HASH maps
[flowspec-xdp]
/
genrules.py
diff --git
a/genrules.py
b/genrules.py
index 37c533ea6832919253fdbd04d6d96887cfd8b7e4..5d90e8c773a414b218a7db7be03f2b5eb3e085f9 100755
(executable)
--- a/
genrules.py
+++ b/
genrules.py
@@
-239,10
+239,10
@@
def dscp_to_rule(proto, rules):
def port_to_rule(ty, rules):
if ty == "port" :
ast = parse_ast(rules, parse_numbers_expr, True)
def port_to_rule(ty, rules):
if ty == "port" :
ast = parse_ast(rules, parse_numbers_expr, True)
- return "if (
!ports_valid
) break;\nif (!( " + ast.write("sport", "dport") + " )) break;"
+ return "if (
sport == -1 || dport == -1
) break;\nif (!( " + ast.write("sport", "dport") + " )) break;"
ast = parse_ast(rules, parse_numbers_expr, True)
ast = parse_ast(rules, parse_numbers_expr, True)
- return "if (
!ports_valid
) break;\nif (!( " + ast.write(ty) + " )) break;"
+ return "if (
" + ty + " == -1
) break;\nif (!( " + ast.write(ty) + " )) break;"
def tcp_flags_to_rule(rules):
ast = parse_ast(rules, parse_bit_expr, False)
def tcp_flags_to_rule(rules):
ast = parse_ast(rules, parse_bit_expr, False)