Browse Source

hard code 0 network in session handling

=> effectively only using 1 net at the moment
master
Nico Schottelius 3 years ago
parent
commit
f55aeddd0e
  1. 8
      p4app/controller.py

8
p4app/controller.py

@ -547,12 +547,12 @@ class L2Controller(object):
tcp_dst_port = pkg[TCP].dport
# FIXME: range, reuse, etc.
idx = self.nat64_session_net[self.mode]['v4_idx']
self.nat64_session_net[self.mode]['v4_idx'] += 1
idx = self.nat64_session_net[self.mode][0]['v4_idx']
self.nat64_session_net[self.mode][0]['v4_idx'] += 1
ipv4_src_addr = self.nat64_session_net[self.mode]['v4_net'][idx]
ipv4_src_addr = self.nat64_session_net[self.mode][0]['v4_net'][idx]
ipv6_dst_addr = ipaddress.IPv6Address(pkg[IPv6].dst)
ipv4_dst_addr = int(ipv6_dst_addr) - int(self.nat64_session_net[self.mode]['v6_net'][0])
ipv4_dst_addr = int(ipv6_dst_addr) - int(self.nat64_session_net[self.mode][0]['v6_net'][0])
log.debug("src v4={}, dst v6 = {}, dst v4 = {}".format(ipv4_src_addr,
ipv6_dst_addr,

Loading…
Cancel
Save