From owner-freebsd-net@freebsd.org Sun Apr 10 18:37:28 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FCF7B0ADDC for ; Sun, 10 Apr 2016 18:37:28 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward18j.cmail.yandex.net (forward18j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::f5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 385041A1D for ; Sun, 10 Apr 2016 18:37:28 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [IPv6:2a02:6b8:0:801:1::13]) by forward18j.cmail.yandex.net (Yandex) with ESMTP id F416820ECC; Sun, 10 Apr 2016 21:37:13 +0300 (MSK) Received: from smtp14.mail.yandex.net (localhost [127.0.0.1]) by smtp14.mail.yandex.net (Yandex) with ESMTP id 2CBB51B60253; Sun, 10 Apr 2016 21:37:13 +0300 (MSK) Received: by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id HL3V6ffZNZ-bC2W2Bpv; Sun, 10 Apr 2016 21:37:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1460313432; bh=KPC/U7WkSDKcUX0Ifhc9zaBnGVXaIpHzpcC39YyMr4w=; h=Subject:To:References:Cc:From:X-Enigmail-Draft-Status:Message-ID: Date:User-Agent:MIME-Version:In-Reply-To:Content-Type; b=V/+KJ8PdBlP4dZVg9/Z9zcyPDxNs33X8dWBXqxUzMZJuftg1DuPy1ymGkGpeUHSWU +uJ3Bn9Q214ECoV8NBzS0tVVP6dMvAHWDqWp1qVbYU5ih5jSQrPJPCYFENI3GGhEjg 7RkIp2kaDW94WZpvDtulsv95DEbBXHxAiY/rUOww= Authentication-Results: smtp14.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-ForeignMX: GB X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: Create socket to send and receive arp packets - Freebsd To: Wafa Hamzah , "freebsd-net@freebsd.org" References: Cc: Meny Yossefi , Yuval Bason From: "Andrey V. Elsukov" X-Enigmail-Draft-Status: N1110 Message-ID: <570A9CED.5060806@yandex.ru> Date: Sun, 10 Apr 2016 21:35:25 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="i5fAVlFTxXtjsvcKGSrq0UbksVLK6f7he" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 18:37:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --i5fAVlFTxXtjsvcKGSrq0UbksVLK6f7he Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 =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). Hi, AFAIR, you can't send ARP packets via RAW sockets in FreeBSD. You need to use bpf(4) or some libraries like libpcap. --=20 WBR, Andrey V. Elsukov --i5fAVlFTxXtjsvcKGSrq0UbksVLK6f7he Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXCpzuAAoJEAHF6gQQyKF6bOIIAIw7DtErIblsO4ePhINFxvIW F4LSvkFq7XlVc4iJjGtwqqle03P5zDWUZEhEMfQzH3LFmiKQa1b+i9XrFyJ5P+BW uUN2oUaY827e/P/avvaatNOvpNs0ZpdtbMxvgouq6Sl+WbNFdDr5aEPOayej107g P/+KFDWSLT/SHLrxixxF3NxToJdftSH9zx/U1DRfF8Gu4Dwpx8m28xkfMjNnrqcR IVqRx8wiKr1MTEawAvj7xfj6l5tkWBpxKzGbGjY8mRnyoEU6HZxHQDYHOxDkWtO3 FtxwTwpuVVFy2sviJcjGAMD1MKDtgtNWb0/YQWp3zyAyzreU315luO4xIlaA5Nk= =g7hE -----END PGP SIGNATURE----- --i5fAVlFTxXtjsvcKGSrq0UbksVLK6f7he--