Re: Q: Extract hardware address from received datagram?

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

 



Albrecht Dreß wrote:

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

I would look at what the ISC DHCP server does, but i'm not sure you will see broadcast traffic from machines in a different network segment, since routers do not generally forward broadcasts.
-
: 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

[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