diff --git a/p4app/controller.py b/p4app/controller.py index 89bbec2..427e28e 100644 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -150,7 +150,7 @@ class L2Controller(object): self.controller.table_add("v6_networks", "set_egress_port", [net], [v6route['port']]) net = str(self.info['ndp_multicast']) - self.controller.table_add("v6_networks", "controller_reply", [net]) + self.controller.table_add("v6_networks", "controller_debug", [net]) self.controller.table_clear("v4_routing") diff --git a/p4src/headers.p4 b/p4src/headers.p4 index 863b115..fb45d31 100644 --- a/p4src/headers.p4 +++ b/p4src/headers.p4 @@ -120,6 +120,7 @@ struct headers { struct metadata { bit<16> tcp_length; bit<16> ethertype; /* we use this, if we are cloning */ + bit<1> ether_modified; } #endif \ No newline at end of file diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 0fad976..920af6e 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -27,12 +27,12 @@ control MyIngress(inout headers hdr, } action controller_debug() { + meta.ether_modified = 1; meta.ethertype = TYPE_DEBUG; clone3(CloneType.I2E, 100, meta); } action controller_reply() { - meta.ethertype = TYPE_CPU; clone3(CloneType.I2E, 100, meta); } @@ -205,7 +205,7 @@ control MyEgress(inout headers hdr, // hdr.tcp.setValid(); // If ingress clone - if (standard_metadata.instance_type == 1){ + if (standard_metadata.instance_type == 1 && meta.ether_modified == 1){ hdr.ethernet.ethertype = meta.ethertype; // hdr.cpu.setValid();