1
0
Fork 0

Add some check

master
Alex Kotov 3 years ago
parent b74ebe03b4
commit 12b601cfcd
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
  1. 3
      main.py

@ -160,6 +160,9 @@ def handle_ip_packet(ip_packet, conn, tun_iface, config):
ip_packet_packed = ip_packet.to_byte_string()
ip_packet_length = struct.pack('>I', len(ip_packet_packed))
if len(ip_packet_packed) != ip_packet.header.total_length:
raise RuntimeError('invalid "total length" header value')
buf = MAGIC + ip_packet_length + ip_packet_packed
if ip_packet.header.dst == config.iface_addr: