app/ping: fix destination MAC on ARP replies

The ARP destination MAC was set to the Ethernet source MAC which is not
necessarily the MAC of the other ARP peer. Instead use the ARP source MAC of
the ARP request.
This commit is contained in:
Martin Stein 2020-01-29 14:49:26 +01:00 committed by Christian Helmuth
parent 3016b64fac
commit a73ef9fc06
1 changed files with 1 additions and 1 deletions

View File

@ -481,7 +481,7 @@ void Main::_send_arp_reply(Ethernet_frame &req_eth,
arp.opcode(Arp_packet::REPLY);
arp.src_mac(_nic.mac());
arp.src_ip(ip_config().interface.address);
arp.dst_mac(req_eth.src());
arp.dst_mac(req_arp.src_mac());
arp.dst_ip(req_arp.src_ip());
});
}