qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/4] linux-user: manage SOCK_PACKET socket type
@ 2015-10-28 19:12 Laurent Vivier
  2015-10-28 19:13 ` [Qemu-devel] [PATCH v2 1/4] linux-user: SOCK_PACKET uses network endian to encode protocol in socket() Laurent Vivier
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Laurent Vivier @ 2015-10-28 19:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, riku.voipio, Laurent Vivier

This is obsolete, but if we want to use dhcp with some distros (like debian
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 the
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 <linux/if_ether.h> 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()) and
    interface name (bind()) in different patches.
    Use TargetFdTrans array to manage the SOCK_PACKET type special case in
    bind().
    The two others patches are here to introduce a new function in TargetFdTrans
    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(-)

-- 
2.4.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-10-28 20:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 19:12 [Qemu-devel] [PATCH v2 0/4] linux-user: manage SOCK_PACKET socket type Laurent Vivier
2015-10-28 19:13 ` [Qemu-devel] [PATCH v2 1/4] linux-user: SOCK_PACKET uses network endian to encode protocol in socket() Laurent Vivier
2015-10-28 19:14   ` Peter Maydell
2015-10-28 19:13 ` [Qemu-devel] [PATCH v2 2/4] linux-user: rename TargetFdFunc to TargetFdDataFunc, and structure fields accordingly Laurent Vivier
2015-10-28 19:15   ` Peter Maydell
2015-10-28 19:13 ` [Qemu-devel] [PATCH v2 3/4] linux-user: add a function hook to translate sockaddr Laurent Vivier
2015-10-28 19:18   ` Peter Maydell
2015-10-28 19:13 ` [Qemu-devel] [PATCH v2 4/4] linux-user: manage bind with a socket of SOCK_PACKET type Laurent Vivier
2015-10-28 19:20   ` Peter Maydell
2015-10-28 19:25     ` Laurent Vivier
2015-10-28 20:09       ` Peter Maydell
2015-10-28 19:21 ` [Qemu-devel] [PATCH v2 0/4] linux-user: manage SOCK_PACKET socket type Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).