From 6e22465ae4b9b2eb71b61e390be7b5f356cba578 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 2 Apr 2019 17:22:21 +0200 Subject: [PATCH] Update arp processing for ethernet --- p4src/static-mapping.p4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; }