Create socket to send and receive arp packets - Freebsd

Wafa Hamzah wafah at mellanox.com
Sun Apr 10 11:35:58 UTC 2016


Hi,

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).

Please advise,






Wafa Hamzah
SW engineer, FreeBSD verification




More information about the freebsd-net mailing list