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']])
 | 
			
		||||
 | 
			
		||||
        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")
 | 
			
		||||
| 
						 | 
				
			
			@ -230,10 +230,12 @@ class L2Controller(object):
 | 
			
		|||
            pass
 | 
			
		||||
        elif packet.type == 0x86dd:
 | 
			
		||||
            pass
 | 
			
		||||
 | 
			
		||||
        elif packet.type == 0x4242:
 | 
			
		||||
            print("Special handling needed")
 | 
			
		||||
            pass
 | 
			
		||||
        elif packet.type == 0x2323:
 | 
			
		||||
            print("Debug pkg")
 | 
			
		||||
            pass
 | 
			
		||||
        else:
 | 
			
		||||
            print("Broken pkg: {}".format(pkg.__repr__()))
 | 
			
		||||
            return
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -201,21 +201,10 @@ control MyEgress(inout headers hdr,
 | 
			
		|||
                 inout metadata meta,
 | 
			
		||||
                 inout standard_metadata_t standard_metadata) {
 | 
			
		||||
	apply {
 | 
			
		||||
        /* set tcp header valid after modifying it -- keep this in mind*/
 | 
			
		||||
        // hdr.tcp.setValid();
 | 
			
		||||
 | 
			
		||||
        // If ingress clone
 | 
			
		||||
        // ingress clone
 | 
			
		||||
        if (standard_metadata.instance_type == 1 && meta.ether_modified == 1){
 | 
			
		||||
            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(),
 | 
			
		||||
MyDeparser()
 | 
			
		||||
) 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue