Skip to content

Commit

Permalink
revise overlay rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaofengWu123 committed Sep 8, 2024
1 parent c8ec03d commit 23e887b
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions dash-pipeline/bmv2/flow_actions/flow_action_overlay_rewrite.p4
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,8 @@ control do_action_overlay_rewrite(
REQUIRES(meta.overlay_data.is_ipv6 == false);

hdr.customer_ipv4.setValid();
hdr.customer_ipv4.version = 4;
hdr.customer_ipv4.ihl = 5;
hdr.customer_ipv4.diffserv = 0;
hdr.customer_ipv4.total_len = hdr.customer_ipv6.payload_length + IPV4_HDR_SIZE;
hdr.customer_ipv4.identification = 1;
hdr.customer_ipv4.flags = 0;
hdr.customer_ipv4.frag_offset = 0;
hdr.customer_ipv4.protocol = hdr.customer_ipv6.next_header;
hdr.customer_ipv4.ttl = hdr.customer_ipv6.hop_limit;
hdr.customer_ipv4.hdr_checksum = 0;
hdr.customer_ipv4.dst_addr = (IPv4Address)((IPv6Address)meta.overlay_data.dip & meta.overlay_data.dip_mask);
hdr.customer_ipv4.src_addr = (IPv4Address)((IPv6Address)meta.overlay_data.sip & meta.overlay_data.sip_mask);

hdr.customer_ipv6.setInvalid();
hdr.customer_ethernet.dst_addr = meta.overlay_data.dmac;
hdr.customer_ethernet.ether_type = IPV4_ETHTYPE;
}
Expand Down

0 comments on commit 23e887b

Please sign in to comment.