Re: Getting the MAC address of a client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Lee Chin wrote:

> When my server application accepts a client socket connection, what is
> the easiest way to obtain the MAC address of the peer? I tried listing
> the ARP table but I did not see an entry for the IP address and MAC
> address of the client.
> 
> I want to avoid having to ping the client to get the ARP table populated

If you don't see the client's MAC address in the ARP table, that
probably means that the client isn't on the same physical (Ethernet)
network as the server. In which case, there's no way that you can
obtain its MAC address.

BTW, pinging won't help in any case. If the client *does* happen to be
on the same network as the server, the MAC address will have been
retrieved in order to send the SYN+ACK.

-- 
Glynn Clements <glynn.clements@virgin.net>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux