hard code 0 network in session handling

=> effectively only using 1 net at the moment
This commit is contained in:
Nico Schottelius 2019-05-06 13:10:40 +02:00
parent 736350eb68
commit f55aeddd0e

View file

@ -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,