Create socket to send and receive arp packets - Freebsd

Andrey V. Elsukov bu7cher at yandex.ru
Sun Apr 10 18:37:28 UTC 2016


On 10.04.16 11:00, Wafa Hamzah wrote:
> We are trying to send arp requests from user space using a RAW
> socket. Our Linux reference suggest the following flags when creating
> the socket: s  = socket (PF_PACKET, SOCK_PACKET, htons(ETH_P_ARP))). 
> For FreeBSD support, we replaced PF_PACKET with PF_ARP , SOCK_PACKET
> with SOCK_RAW and htons(ETH_P_ARP) with  ETHERTYPE_ARP Which resulted
> in a failure to create the socket (the return code was -1).

Hi,

AFAIR, you can't send ARP packets via RAW sockets in FreeBSD. You need
to use bpf(4) or some libraries like libpcap.

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 538 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20160410/fc0d3e5d/attachment.sig>


More information about the freebsd-net mailing list