Keep packet type correct for multicast / ndp
This commit is contained in:
parent
142bc29c82
commit
6f83eeddb2
2 changed files with 16 additions and 14 deletions
|
@ -150,7 +150,7 @@ class L2Controller(object):
|
||||||
self.controller.table_add("v6_networks", "set_egress_port", [net], [v6route['port']])
|
self.controller.table_add("v6_networks", "set_egress_port", [net], [v6route['port']])
|
||||||
|
|
||||||
net = str(self.info['ndp_multicast'])
|
net = str(self.info['ndp_multicast'])
|
||||||
self.controller.table_add("v6_networks", "controller_debug", [net])
|
self.controller.table_add("v6_networks", "controller_reply", [net])
|
||||||
|
|
||||||
|
|
||||||
self.controller.table_clear("v4_routing")
|
self.controller.table_clear("v4_routing")
|
||||||
|
@ -230,10 +230,12 @@ class L2Controller(object):
|
||||||
pass
|
pass
|
||||||
elif packet.type == 0x86dd:
|
elif packet.type == 0x86dd:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif packet.type == 0x4242:
|
elif packet.type == 0x4242:
|
||||||
print("Special handling needed")
|
print("Special handling needed")
|
||||||
pass
|
pass
|
||||||
|
elif packet.type == 0x2323:
|
||||||
|
print("Debug pkg")
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
print("Broken pkg: {}".format(pkg.__repr__()))
|
print("Broken pkg: {}".format(pkg.__repr__()))
|
||||||
return
|
return
|
||||||
|
|
|
@ -201,21 +201,10 @@ control MyEgress(inout headers hdr,
|
||||||
inout metadata meta,
|
inout metadata meta,
|
||||||
inout standard_metadata_t standard_metadata) {
|
inout standard_metadata_t standard_metadata) {
|
||||||
apply {
|
apply {
|
||||||
/* set tcp header valid after modifying it -- keep this in mind*/
|
// ingress clone
|
||||||
// hdr.tcp.setValid();
|
|
||||||
|
|
||||||
// If ingress clone
|
|
||||||
if (standard_metadata.instance_type == 1 && meta.ether_modified == 1){
|
if (standard_metadata.instance_type == 1 && meta.ether_modified == 1){
|
||||||
hdr.ethernet.ethertype = meta.ethertype;
|
hdr.ethernet.ethertype = meta.ethertype;
|
||||||
|
|
||||||
// hdr.cpu.setValid();
|
|
||||||
// hdr.cpu.srcAddr = hdr.ethernet.srcAddr;
|
|
||||||
// hdr.cpu.ingress_port = (bit<16>)meta.ingress_port;
|
|
||||||
|
|
||||||
// truncate((bit<32>)22); //ether+cpu header
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,3 +220,14 @@ MyEgress(),
|
||||||
MyComputeChecksum(),
|
MyComputeChecksum(),
|
||||||
MyDeparser()
|
MyDeparser()
|
||||||
) main;
|
) main;
|
||||||
|
|
||||||
|
|
||||||
|
/* set tcp header valid after modifying it -- keep this in mind*/
|
||||||
|
// hdr.tcp.setValid();
|
||||||
|
|
||||||
|
|
||||||
|
// hdr.cpu.setValid();
|
||||||
|
// hdr.cpu.srcAddr = hdr.ethernet.srcAddr;
|
||||||
|
// hdr.cpu.ingress_port = (bit<16>)meta.ingress_port;
|
||||||
|
|
||||||
|
// truncate((bit<32>)22); //ether+cpu header
|
||||||
|
|
Loading…
Reference in a new issue