Q: Extract hardware address from received datagram?

From: Albrecht Dreß
Date: Sun Aug 14 2005 - 08:39:59 EST


Hi all,

is there any possibility to read the hardware address (MAC) of the remote machine from received PF_INET/SOCK_DGRAM packets?

I want to write an application which opens a datagram socket, binds it to a specific port and receives broadcast messages. The sending machine is not necessarily in the same net segment. It is of course easy to get the remote ip address, but I also need the in the information in the packet header, in particular the 6-byte hardware (MAC) address of the sending machine. Apparently /proc/net/arp does not contain any information extracted from such packets.

Any idea how I could get this information? Any pointer/example?

Thanks in advance
Cheers

Albrecht

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Albrecht Dreß - Johanna-Kirchner-Straße 13 - D-53123 Bonn (Germany)
Phone (+49) 228 6199571 - mailto:albrecht.dress@xxxxxxxx
GnuPG public key: http://home.arcor.de/dralbrecht.dress/pubkey.asc
_________________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html