Introduce the icmp6 table
This commit is contained in:
parent
e1dcc092c5
commit
5f14967a32
4 changed files with 94 additions and 80 deletions
|
|
@ -181,10 +181,19 @@ class L2Controller(object):
|
|||
icmp6_net = "{}/128".format(icmp6_addr)
|
||||
mac_addr = self.info['mac_addr']
|
||||
|
||||
self.controller.table_add("v6_networks",
|
||||
self.controller.table_add("icmp6",
|
||||
"icmp6_neighbor_solicitation",
|
||||
[str(icmp6_net)], [str(addr), str(mac_addr)])
|
||||
|
||||
def init_icmp6_echo_in_switch(self, addr):
|
||||
icmp6_addr = addr
|
||||
icmp6_net = "{}/128".format(icmp6_addr)
|
||||
|
||||
self.controller.table_add("icmp6",
|
||||
"icmp6_echo_reply",
|
||||
[str(icmp6_net)], [str(addr)])
|
||||
|
||||
|
||||
def fill_tables(self):
|
||||
self.controller.table_clear("v6_networks")
|
||||
for v6route in self.v6_routes[self.mode]:
|
||||
|
|
@ -193,15 +202,17 @@ class L2Controller(object):
|
|||
if self.args.multicast_to_controller:
|
||||
self.listen_to_icmp6_multicast()
|
||||
|
||||
self.controller.table_clear("icmp6")
|
||||
for v6addr in self.v6_addresses[self.mode]:
|
||||
self.init_ndp_in_switch(v6addr)
|
||||
self.init_icmp6_echo_in_switch(v6addr)
|
||||
|
||||
|
||||
self.controller.table_clear("v4_networks")
|
||||
for v4route in self.v4_routes[self.mode]:
|
||||
self.controller.table_add("v4_networks", "set_egress_port", [str(v4route['net'])], [str(v4route['port'])])
|
||||
|
||||
|
||||
self.controller.table_clear("v6_addresses")
|
||||
# Disable icmp handling in the controller
|
||||
# for v6addr in self.v6_addresses[self.mode]:
|
||||
# log.debug("Adding v6 address: {}".format(v6addr))
|
||||
|
|
@ -216,7 +227,7 @@ class L2Controller(object):
|
|||
|
||||
# # Experimental: controller does NDP, switch does ICMP6 echo reply
|
||||
# self.controller.table_add("v6_addresses", "controller_reply", [str(another_addr_ns)], [str(self.task['ICMP6_NS'])])
|
||||
# self.controller.table_add("v6_addresses", "icmp6_echo_reply", [str(another_addr)])
|
||||
|
||||
|
||||
for nat64map in self.nat64_map[self.mode]:
|
||||
self.static_nat64_mapping(**nat64map)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue