Change protocol in case of icmp6->icmp
This commit is contained in:
parent
b12388c7e5
commit
e349de5859
2 changed files with 23 additions and 6 deletions
|
|
@ -71,11 +71,25 @@ control MyIngress(inout headers hdr,
|
|||
hdr.ipv4.src_addr = src;
|
||||
|
||||
hdr.ipv4.ttl = hdr.ipv6.hop_limit;
|
||||
|
||||
hdr.ipv4.protocol = hdr.ipv6.next_header;
|
||||
|
||||
switch(hdr.ipv6.next_header) {
|
||||
PROTO_ICMP6: {
|
||||
nat64_icmp6;
|
||||
}
|
||||
}
|
||||
|
||||
hdr.ipv6.setInvalid();
|
||||
}
|
||||
|
||||
action nat64_icmp6()
|
||||
{
|
||||
|
||||
hdr.ipv4.protocol = PROTO_ICMP; // overwrite generic same protocol assumption
|
||||
|
||||
}
|
||||
|
||||
/* NAT46: protocol unspecific changes */
|
||||
action nat46_generic(ipv6_addr_t src, ipv6_addr_t dst) {
|
||||
hdr.ipv6.setValid();
|
||||
|
|
@ -383,7 +397,4 @@ MyIngress(),
|
|||
MyEgress(),
|
||||
MyComputeChecksum(),
|
||||
MyDeparser()
|
||||
) main;
|
||||
|
||||
|
||||
// truncate((bit<32>)22); //ether+cpu header
|
||||
) main;
|
||||
Loading…
Add table
Add a link
Reference in a new issue