Skip to content
Snippets Groups Projects
Commit 0d61b9db authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

fix bug del chksum pkt

parent a2f5c6e5
Branches
No related tags found
No related merge requests found
......@@ -58,6 +58,8 @@ def process_packet(new_packet):
else:
pkt.options[index_custom_option].add_entry(my_id, inter_num, Cmd.REGISTER)
del pkt.len
del pkt.ihl
del pkt[IP].chksum # Invalidate the checksum
new_packet.set_payload(bytes(pkt))
pkt.show() # Now this will work correctly
......@@ -77,7 +79,7 @@ def main():
for i in range(MIN_INTER_NUMBER, MAX_INTER_NUMBER):
inter_name = MARK_TO_INTERFACE[i]
rule_2 = f"sudo iptables -t mangle -A PREROUTING -i {inter_name} -j MARK --set-mark {i}"
rule_2 = f"sudo iptables -t mangle -A FORWARD -i br0 -m physdev --physdev-in {inter_name} -j MARK --set-mark {i}"
subprocess.run(rule_2, shell=True, check=True)
print("Rule added successfully.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment