Can udp client got server MAC?


  recvfrom(0,gDATABUF, ret, DstIP,&DstPort);
  sendto(0,gDATABUF,data_length, DstIP, DstPort);

DstIP is udp server ip, DstPort is port, but how can I get server MAC

1 Like

Good question. There seems to be no way to know MAC address from the received packet, but when you send UDP packet back to the target IP you’d get MAC address in the DHAR. So after your sendto you can obtain the MAC address, but not before it.

Many thanks! ARP can slove it.