From owner-freebsd-net@freebsd.org Sun Apr 10 11:35:58 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 5876BAE26CB for ; Sun, 10 Apr 2016 11:35:58 +0000 (UTC) (envelope-from wafah@mellanox.com) Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0100.outbound.protection.outlook.com [157.56.112.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEED3105D for ; Sun, 10 Apr 2016 11:35:57 +0000 (UTC) (envelope-from wafah@mellanox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HW57LrmHD9rFbeSjFVh5KPRZmqKcnP0RC6uGpK0L7nw=; b=a1pxBVHLGTdurI4cpSvWNMauE2HZPDgvVKUFeYjSjpzDzzZmLZ9+l4TAJfX47t1wtX06lUhH++C/QpKd9Z1MDTo1lgNW/WahUy93wfBq7JCi3o6ARbFV+2MADbry2mNdfT9SOOyxKFKCFx0nlBwTRKQA2VpnDIy65E8lAx5FW4k= Received: from HE1PR05MB1676.eurprd05.prod.outlook.com (10.169.119.154) by HE1PR05MB1306.eurprd05.prod.outlook.com (10.162.250.151) with Microsoft SMTP Server (TLS) id 15.1.447.15; Sun, 10 Apr 2016 08:00:51 +0000 Received: from HE1PR05MB1676.eurprd05.prod.outlook.com ([10.169.119.154]) by HE1PR05MB1676.eurprd05.prod.outlook.com ([10.169.119.154]) with mapi id 15.01.0453.028; Sun, 10 Apr 2016 08:00:51 +0000 From: Wafa Hamzah To: "freebsd-net@freebsd.org" CC: Meny Yossefi , Yuval Bason Subject: Create socket to send and receive arp packets - Freebsd Thread-Topic: Create socket to send and receive arp packets - Freebsd Thread-Index: AdGS/vMmvJQbA6w/Rh6OngjzhaUatA== Date: Sun, 10 Apr 2016 08:00:50 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [5.34.160.170] x-ms-office365-filtering-correlation-id: eb532ba8-eb0a-4af9-e266-08d361163bcf x-microsoft-exchange-diagnostics: 1; HE1PR05MB1306; 5:a7flyX3U/BBhgbPRyZNdsliX7XoqK4Gou41vz9oOLAnxAl9LO3V0ldIRaEhyB8MEFTdPxZzG9+4jfKgKeiKM+CuehbL4c0CIzZDaNzPB5iuAajBha+RqBeVfD6PijbOcvwiEy9nt52ueUPqfvJ6Byg==; 24:okJd44WC/kxHkxqlhn1XZg7YFMaZog9w8JEaHTMabe/mWmuYD3+WPZF3cqROe8SQ9YhEW6WJIHcmCWqsoamhgP+5E9B6MPN0Mg1bd40cV8c= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1306; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:HE1PR05MB1306; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1306; x-forefront-prvs: 09086FB5C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(2906002)(4001430100002)(2501003)(3660700001)(33656002)(76576001)(586003)(2900100001)(4326007)(5008740100001)(16236675004)(3280700002)(5630700001)(11100500001)(229853001)(189998001)(74316001)(9686002)(110136002)(92566002)(107886002)(2351001)(10400500002)(54356999)(19300405004)(86362001)(122556002)(5004730100002)(15975445007)(71446004)(19580395003)(5003600100002)(77096005)(81166005)(5002640100001)(87936001)(1096002)(790700001)(50986999)(97736004)(6116002)(19625215002)(102836003)(66066001)(3846002)(450100001)(5640700001)(1220700001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1306; H:HE1PR05MB1676.eurprd05.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2016 08:00:50.8151 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1306 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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 11:35:58 -0000 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= =3D socket (PF_PACKET, SOCK_PACKET, htons(ETH_P_ARP))). For FreeBSD support, we replaced PF_PACKET with PF_ARP , SOCK_PACKET with S= OCK_RAW and htons(ETH_P_ARP) with ETHERTYPE_ARP Which resulted in a failur= e to create the socket (the return code was -1). Please advise, Wafa Hamzah SW engineer, FreeBSD verification