Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Apr 2016 19:56:45 +0200
From:      Kristof Provost <kristof@sigsegv.be>
To:        Wafa Hamzah <wafah@mellanox.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Meny Yossefi <menyy@mellanox.com>, Yuval Bason <yuvalba@mellanox.com>
Subject:   Re: Create socket to send and receive arp packets - Freebsd 
Message-ID:  <BC1A9CD0-8A5C-43A5-94E5-FE9CED469C33@sigsegv.be>
In-Reply-To: <HE1PR05MB167607CA9428AC5AEF0E8501DC930@HE1PR05MB1676.eurprd05.prod.outlook.com>
References:  <HE1PR05MB167607CA9428AC5AEF0E8501DC930@HE1PR05MB1676.eurprd05.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On 10 Apr 2016, at 10:00, Wafa Hamzah <wafah@mellanox.com> wrote:
>=20
> Hi,
>=20
> 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  =3D 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).
>=20
> Please advise,
I=E2=80=99d start by looking at =E2=80=98errno=E2=80=99, because =
that=E2=80=99ll tell you a little more.
It should give you a better indication of why the call fails.

It might also be useful to reduce the code to the bare minimum required
to reproduce your problem. Not only will that often help you to find the =
problem
it also makes it easier to post the code, which is the next step in =
helping you.

Regards,
Kristof=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BC1A9CD0-8A5C-43A5-94E5-FE9CED469C33>