diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 1d8e1ec..9b5b267 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -336,12 +336,17 @@ Echo or Echo Reply Message action arp_reply(mac_addr_t mac_addr) { ipv4_addr_t tmp = hdr.arp.src_ipv4_addr; - hdr.arp.src_mac_addr = mac_addr; - hdr.arp.src_ipv4_addr = hdr.arp.dst_ipv4_addr; + /* fill the ethernet header */ + hdr.ethernet.src_addr = mac_addr; + hdr.ethernet.dst_addr = hdr.arp.src_mac_addr; + /* fill the arp header */ hdr.arp.dst_mac_addr = hdr.arp.src_mac_addr; hdr.arp.dst_ipv4_addr = tmp; + hdr.arp.src_mac_addr = mac_addr; + hdr.arp.src_ipv4_addr = hdr.arp.dst_ipv4_addr; + hdr.arp.opcode = ARP_REPLY; }