Skip to content
Snippets Groups Projects
Commit e4ac73b4 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

NET ip-man table 39

parent c7cf8b3e
No related branches found
No related tags found
No related merge requests found
...@@ -317,11 +317,12 @@ def inet(*args, **kvargs): ...@@ -317,11 +317,12 @@ def inet(*args, **kvargs):
@cmd @cmd
@daemon(root_only=True) @daemon(root_only=True)
def init(ucred): def init(ucred):
for p in [10001, 10012, 10038]: for p in [10001, 10012, 10038, 10039]:
inet("rule", "del", "priority", p, check=False) inet("rule", "del", "priority", p, check=False)
ip("rule", "add", "priority", 10001, "to", "95.85.217.30", "dport", "12061", "goto", 32766) ip("rule", "add", "priority", 10001, "to", "95.85.217.30", "dport", "12061", "goto", 32766)
inet("rule", "add", "priority", 10012, "table", 12) inet("rule", "add", "priority", 10012, "table", 12)
inet("rule", "add", "priority", 10038, "table", 38) inet("rule", "add", "priority", 10038, "table", 38)
inet("rule", "add", "priority", 10039, "table", 39)
def find_empty_priority(base, used, range_size=10): def find_empty_priority(base, used, range_size=10):
while True: while True:
...@@ -349,7 +350,7 @@ def replace_rule(ucred, *tables: tuple[str, ...], priority_base: int = 20000, i ...@@ -349,7 +350,7 @@ def replace_rule(ucred, *tables: tuple[str, ...], priority_base: int = 20000, i
if "iif" in r and iif == r["iif"]: if "iif" in r and iif == r["iif"]:
ip(ipv, "rule", "del", "priority", r["priority"]) ip(ipv, "rule", "del", "priority", r["priority"])
if not iif: if not iif:
if r["priority"] not in [0, 10001, 10012, 10038, 32766, 32767] and "iif" not in r and "dst" not in r: if r["priority"] not in [0, 10001, 10012, 10038, 10039, 32766, 32767] and "iif" not in r and "dst" not in r:
ip(ipv, "rule", "del", "priority", r["priority"]) ip(ipv, "rule", "del", "priority", r["priority"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment