Also add required icmp6_type

This commit is contained in:
Nico Schottelius 2019-03-23 15:07:07 +01:00
parent 5f14967a32
commit 4d3641fc50
3 changed files with 5 additions and 5 deletions

View file

@ -874,7 +874,6 @@ user@T:~# iptables -t mangle -A PREROUTING \
5656 5656
**** Cisco (?) **** Cisco (?)
*** P4 based implementation *** P4 based implementation
TBD
**** General **** General
- IPv6 subnet 2001:db8::/32 - IPv6 subnet 2001:db8::/32
@ -1203,6 +1202,7 @@ But unless I am missing something obvious, P4 hides it…
**** ICMP6: checksum over payload **** ICMP6: checksum over payload
- variable length, up to 65k - variable length, up to 65k
Exists:
**** Synchronisation with the controller **** Synchronisation with the controller
- Double data type definition -> might differ - Double data type definition -> might differ
- TYPE_CPU for ethernet - TYPE_CPU for ethernet

View file

@ -179,19 +179,21 @@ class L2Controller(object):
def init_ndp_in_switch(self, addr): def init_ndp_in_switch(self, addr):
icmp6_addr = self.gen_ndp_multicast_addr(addr) icmp6_addr = self.gen_ndp_multicast_addr(addr)
icmp6_net = "{}/128".format(icmp6_addr) icmp6_net = "{}/128".format(icmp6_addr)
icmp6_type = 135
mac_addr = self.info['mac_addr'] mac_addr = self.info['mac_addr']
self.controller.table_add("icmp6", self.controller.table_add("icmp6",
"icmp6_neighbor_solicitation", "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): def init_icmp6_echo_in_switch(self, addr):
icmp6_addr = addr icmp6_addr = addr
icmp6_type = 128
icmp6_net = "{}/128".format(icmp6_addr) icmp6_net = "{}/128".format(icmp6_addr)
self.controller.table_add("icmp6", self.controller.table_add("icmp6",
"icmp6_echo_reply", "icmp6_echo_reply",
[str(icmp6_net)], [str(addr)]) [str(icmp6_net), str(icmp6_type)], [str(addr)])
def fill_tables(self): def fill_tables(self):

View file

@ -301,8 +301,6 @@ control MyIngress(inout headers hdr,
// ndp_answer.apply(); // ndp_answer.apply();
//ndp.apply(); /* flood or if it is us - answer */ //ndp.apply(); /* flood or if it is us - answer */
icmp6.apply(); icmp6.apply();
v6_networks.apply(); v6_networks.apply();
} }