From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrW9w-00048y-BM for qemu-devel@nongnu.org; Wed, 28 Oct 2015 15:13:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrW9s-0005n8-9j for qemu-devel@nongnu.org; Wed, 28 Oct 2015 15:13:20 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:6137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrW9s-0005lU-3c for qemu-devel@nongnu.org; Wed, 28 Oct 2015 15:13:16 -0400 From: Laurent Vivier Date: Wed, 28 Oct 2015 20:12:59 +0100 Message-Id: <1446059583-16340-1-git-send-email-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 0/4] linux-user: manage SOCK_PACKET socket type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, Laurent Vivier This is obsolete, but if we want to use dhcp with some distros (like debi= an ppc 8.2 jessie), we need it. At the bind level, we are not able to know the socket type so we try to guess it by analyzing the name. We manage only the case "ethX", "ethX" in spk_device is similar to set htons(0x6574) in sll_protocol in t= he normal case, and as this protocol does not exist, it's ok. SOCK_PACKET uses network endian to encode protocol in socket() in PACKET(7) : protocol is the IEEE 802.3 protocol number in network order. See the include file for a list of allowed protocols. When protocol is set to htons(ETH_P_ALL) then all protocols are received. All incoming packets of that protocol type will be passed to the packet socket before they are passed to the protocols implemented in the kernel. v2: Split the patch in 4 parts to manage protocol endianness (socket()) a= nd interface name (bind()) in different patches. Use TargetFdTrans array to manage the SOCK_PACKET type special case i= n bind(). The two others patches are here to introduce a new function in Target= FdTrans to translate sockaddr data structure (rename previous functions to be clear). Laurent Vivier (4): linux-user: SOCK_PACKET uses network endian to encode protocol in socket() linux-user: rename TargetFdFunc to TargetFdDataFunc, and structure fields accordingly linux-user: add a function hook to translate sockaddr linux-user: manage bind with a socket of SOCK_PACKET type. linux-user/syscall.c | 95 ++++++++++++++++++++++++++++++++++++++++++++--= ------ 1 file changed, 81 insertions(+), 14 deletions(-) --=20 2.4.3