Update arp processing for ethernet
This commit is contained in:
parent
09ad815e7c
commit
6e22465ae4
1 changed files with 7 additions and 2 deletions
|
@ -336,12 +336,17 @@ Echo or Echo Reply Message
|
||||||
action arp_reply(mac_addr_t mac_addr) {
|
action arp_reply(mac_addr_t mac_addr) {
|
||||||
ipv4_addr_t tmp = hdr.arp.src_ipv4_addr;
|
ipv4_addr_t tmp = hdr.arp.src_ipv4_addr;
|
||||||
|
|
||||||
hdr.arp.src_mac_addr = mac_addr;
|
/* fill the ethernet header */
|
||||||
hdr.arp.src_ipv4_addr = hdr.arp.dst_ipv4_addr;
|
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_mac_addr = hdr.arp.src_mac_addr;
|
||||||
hdr.arp.dst_ipv4_addr = tmp;
|
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;
|
hdr.arp.opcode = ARP_REPLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue