summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Edmond <seanedmond@microsoft.com>2024-04-29 11:51:16 -0700
committerTom Rini <trini@konsulko.com>2025-01-01 14:40:04 -0600
commitec9263b4f15c4cf82eb6a211c67baa6385065b8e (patch)
treeaeb67a213b774a72800bbc61def1aa15f9928433
parenteeee0e2b850d2b76d102fc1acca9e3101b1baf3a (diff)
Fix neighbor discovery ethernet address saving
When a successful neighbor advertisement is received, the ethernet address should be saved for later use to avoid having to redo the neighbor discovery process. For example, with TFTP the address should get saved into "net_server_ethaddr". This is being done correctly with ARP for IPv4, but not for neighbor discovery with IPv6. Signed-off-by: Sean Edmond <seanedmond@microsoft.com> Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
-rw-r--r--net/ndisc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ndisc.c b/net/ndisc.c
index d417c5987ac..641cf6d8385 100644
--- a/net/ndisc.c
+++ b/net/ndisc.c
@@ -460,8 +460,8 @@ int ndisc_receive(struct ethernet_hdr *et, struct ip6_hdr *ip6, int len)
ndisc_extract_enetaddr(ndisc, neigh_eth_addr);
/* save address for later use */
- if (!net_nd_packet_mac)
- net_nd_packet_mac = neigh_eth_addr;
+ if (net_nd_packet_mac)
+ memcpy(net_nd_packet_mac, neigh_eth_addr, 6);
/* modify header, and transmit it */
memcpy(((struct ethernet_hdr *)net_nd_tx_packet)->et_dest,