From 4d3641fc5023d5d589b4f84bd0ff80fca659f599 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 23 Mar 2019 15:07:07 +0100 Subject: [PATCH] Also add required icmp6_type --- doc/plan.org | 2 +- p4app/controller.py | 6 ++++-- p4src/static-mapping.p4 | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index ca5ac03..39833c0 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -874,7 +874,6 @@ user@T:~# iptables -t mangle -A PREROUTING \ 5656 **** Cisco (?) *** P4 based implementation - TBD **** General - IPv6 subnet 2001:db8::/32 @@ -1203,6 +1202,7 @@ But unless I am missing something obvious, P4 hides it… **** ICMP6: checksum over payload - variable length, up to 65k +Exists: **** Synchronisation with the controller - Double data type definition -> might differ - TYPE_CPU for ethernet diff --git a/p4app/controller.py b/p4app/controller.py index 7342184..cef53cc 100755 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -179,19 +179,21 @@ class L2Controller(object): def init_ndp_in_switch(self, addr): icmp6_addr = self.gen_ndp_multicast_addr(addr) icmp6_net = "{}/128".format(icmp6_addr) + icmp6_type = 135 mac_addr = self.info['mac_addr'] self.controller.table_add("icmp6", "icmp6_neighbor_solicitation", - [str(icmp6_net)], [str(addr), str(mac_addr)]) + [str(icmp6_net), str(icmp6_type)], [str(addr), str(mac_addr)]) def init_icmp6_echo_in_switch(self, addr): icmp6_addr = addr + icmp6_type = 128 icmp6_net = "{}/128".format(icmp6_addr) self.controller.table_add("icmp6", "icmp6_echo_reply", - [str(icmp6_net)], [str(addr)]) + [str(icmp6_net), str(icmp6_type)], [str(addr)]) def fill_tables(self): diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 58c2b2f..c89252d 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -301,8 +301,6 @@ control MyIngress(inout headers hdr, // ndp_answer.apply(); //ndp.apply(); /* flood or if it is us - answer */ - - icmp6.apply(); v6_networks.apply(); }