[Qemu-devel] [PATCHv10 01/11] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-03-08 Thread Samuel Thibault
he RFC, to make the guest refresh its route. This also adds ip6_cksum() to compute ICMPv6 checksums using IPv6 pseudo-header. Some #define ETH_* are moved upper in slirp.h to make them accessible to other slirp/*.h Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Sam

[Qemu-devel] [PATCHv10 04/11] slirp: Adding IPv6 UDP support

2016-03-08 Thread Samuel Thibault
<maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/Makefile.objs | 2 +- slirp/ip6_input.c | 2 +- slirp/socket.c | 43 +++--- slirp/socket.h | 6 ++ slirp/udp.h

[Qemu-devel] [PATCHv10 09/11] slirp: Adding IPv6 address for DNS relay

2016-03-08 Thread Samuel Thibault
resses. For now this only points to localhost. Further development will be needed to automatically fetch the IPv6 address from resolv.conf, and announce this via RDNSS. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> R

[Qemu-devel] [PATCHv10 05/11] slirp: Factorizing tcpiphdr structure with an union

2016-03-08 Thread Samuel Thibault
margin computation in various functions, and makes them compatible with the new tcpiphdr structure, whose size will be bigger than sizeof(struct tcphdr) + sizeof(struct ip) Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> R

[Qemu-devel] [PATCHv10 10/11] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-03-08 Thread Samuel Thibault
ec0::3. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- net/net.c| 31 ++ net/slirp.c | 81 +++- qapi-schema.json | 12 + qem

[Qemu-devel] [PATCHv10 08/11] slirp: Handle IPv6 in TCP functions

2016-03-08 Thread Samuel Thibault
; Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/ip6_input.c | 3 ++- slirp/tcp.h| 2 ++ slirp/tcp_input.c | 72 +- slirp/tcp_output.c | 16

[Qemu-devel] [PATCHv10 06/11] slirp: Generalizing and neutralizing various TCP functions before adding IPv6 stuff

2016-03-08 Thread Samuel Thibault
they are working on. This patch does not include the entailed reindentation, to make proofread easier. Reindentation is adressed in the following no-op patch. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: T

[Qemu-devel] [PATCHv10 02/11] slirp: Fix ICMP error sending

2016-03-08 Thread Samuel Thibault
From: Yann Bordenave <m...@meowstars.org> Disambiguation : icmp_error is renamed into icmp_send_error, since it doesn't manage errors, but only sends ICMP Error messages. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyo

[Qemu-devel] [PATCHv10 07/11] slirp: Reindent after refactoring

2016-03-08 Thread Samuel Thibault
From: Guillaume Subiron <maet...@subiron.org> No code change. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> ---

[Qemu-devel] [PATCHv10 0/11] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-08 Thread Samuel Thibault
Hello, This is another respin of IPv6 in Qemu -net user mode. These patches add ICMPv6, NDP, make UDP and TCP compatible with IPv6, and add TFTP over IPv6. Difference with version 9 is: - split icmp error patch in two - fix sending icmp6 errors on unreachable net or host - forbidding prefix

[Qemu-devel] [PATCHv10 11/11] slirp: Add IPv6 support to the TFTP code

2016-03-08 Thread Samuel Thibault
th <th...@redhat.com> Reviewed-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/tftp.c | 133 +-- slirp/tftp.h | 7 ++-- slirp/udp.c | 16 --- slirp/udp6.c | 16 +-- 4 files changed, 100 insertions(+), 72 deletions(-)

[Qemu-devel] [PATCHv10 03/11] slirp: Adding ICMPv6 error sending

2016-03-08 Thread Samuel Thibault
denave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/ip6_icmp.c | 66 +++ slirp/ip6_icmp.h | 10 + slirp/ip6_input.c | 11 +++

[Qemu-devel] [PULL] MAINTAINERS: Add Samuel Thibault as slirp maintainer

2016-03-08 Thread Samuel Thibault
-thibault for you to fetch changes up to 1aa0033e3b8cce188be885573763552baccb1316: MAINTAINERS: Add Samuel Thibault as slirp maintainer (2016-03-07 14:42:51 +0100) Add Samuel Thibault as slirp maintainer

[Qemu-devel] [PULL] MAINTAINERS: Add Samuel Thibault as slirp maintainer

2016-03-08 Thread Samuel Thibault
From: Samuel Thibault <samuel.thiba...@gnu.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2f5a338..a316bc3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1217,6

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-08 Thread Samuel Thibault
Jason Wang, on Tue 08 Mar 2016 10:15:57 +0800, wrote: > Build works but get some warnings: > > > slirp/ip6_icmp.c: In function 'icmp6_send_error': > slirp/ip6_icmp.c:84:5: warning: implicit declaration of function > 'inet_ntop' [-Wimplicit-function-declaration] > inet_ntop(AF_INET6,

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-08 Thread Samuel Thibault
Jason Wang, on Tue 08 Mar 2016 10:48:27 +0800, wrote: > ./scripts/checkpatch.pl > 0001-slirp-Adding-IPv6-ICMPv6-Echo-and-NDP-autoconfigurat.patch > ERROR: return is not a function, parentheses are not required > #177: FILE: slirp/ip6.h:65: > +return (a->s6_addr[prefix_len / 8] & ((1U << (8 -

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-07 Thread Samuel Thibault
Hello, Thomas Huth, on Mon 07 Mar 2016 16:37:59 +0100, wrote: > Is that "#include " required in ip6.h at all? It also seems > to compile if I omit that include completely here... Well, it makes sense to put it in ip6.h. That said, since ip6.h is only included through slirp.h which includes

[Qemu-devel] [PULL] MAINTAINERS: Add Samuel Thibault as slirp maintainer

2016-03-07 Thread Samuel Thibault
From: Samuel Thibault <samuel.thiba...@gnu.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2f5a338..a316bc3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1217,6

[Qemu-devel] [PULL] MAINTAINERS: Add Samuel Thibault as slirp maintainer

2016-03-07 Thread Samuel Thibault
to fetch changes up to 1aa0033e3b8cce188be885573763552baccb1316: MAINTAINERS: Add Samuel Thibault as slirp maintainer (2016-03-07 14:42:51 +0100) Samuel Thibault (1): MAINTAINERS: Add Samuel Thibault as slirp maintainer

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-07 Thread Samuel Thibault
Thomas Huth, on Mon 07 Mar 2016 13:00:48 +0100, wrote: > On 07.03.2016 12:19, Samuel Thibault wrote: > > Jason Wang, on Mon 07 Mar 2016 14:48:16 +0800, wrote: > >> - I expects a unit-test for this. You may want to have a look at the > >> pxe-test in tests/, I think i

Re: [Qemu-devel] [PATCHv9 02/10] slirp: Adding ICMPv6 error sending

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 14:55:52 +0800, wrote: > On 02/23/2016 03:28 AM, Samuel Thibault wrote: > > From: Yann Bordenave <m...@meowstars.org> > > > > Disambiguation : icmp_error is renamed into icmp_send_error, since it > > doesn't manage errors, b

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-07 Thread Samuel Thibault
Jan Kiszka, on Mon 07 Mar 2016 13:06:20 +0100, wrote: > On 2016-03-07 12:09, Samuel Thibault wrote: > > Jason Wang, on Mon 07 Mar 2016 13:03:11 +0800, wrote: > >> Btw, do you want to be the maintainer of slirp? (Or maybe Tohmas want to > >> do this?) > > > >

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 14:48:16 +0800, wrote: > - the series does not build on w32: > In file included from ./slirp/slirp.h:126:0, > from stubs/slirp.c:3: > ./slirp/ip6.h:9:24: fatal error: netinet/in.h: No such file or directory Is it the only issue? Does it build if

Re: [Qemu-devel] [PATCHv9 09/10] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 15:05:05 +0800, wrote: > Please do unnecessary changes like this since it will cause extra effort > for git blame and other things. Ok. I just do hope that no other reviewer will come and say that we should fix the alignment of the parameters. Samuel

Re: [Qemu-devel] [PATCHv9 09/10] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 15:05:05 +0800, wrote: > Please do unnecessary changes like this since it will cause extra effort > for git blame and other things. Which is exactly why we avoided to fix all the checkpatch warnings by leaving existing non-qemu-style indentation. Samuel

Re: [Qemu-devel] [PATCHv9 06/10] slirp: Reindent after refactoring

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 15:02:53 +0800, wrote: > On 02/23/2016 03:28 AM, Samuel Thibault wrote: > > From: Guillaume Subiron <maet...@subiron.org> > > > > No code change. > > > > Signed-off-by: Guillaume Subiron <maet...@subiron.org> > >

Re: [Qemu-devel] [PATCHv9 03/10] slirp: Adding IPv6 UDP support

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 14:57:11 +0800, wrote: > Part of the codes looks duplicated with ipv4 version. Any chances to > merge them like tcp? The duplication is actually quite small: accessing the ip length is different, filling the address is different, etc. So there are differences all

Re: [Qemu-devel] [PATCHv9 01/10] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 14:53:54 +0800, wrote: > > +switch (ip6->ip_nh) { > > +#if 0 > > +case IPPROTO_TCP: > > +tcp_input(m, hlen, (struct socket *)NULL); > > +break; > > +case IPPROTO_UDP: > > +udp_input(m, hlen); > > +break; > > +#endif > >

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 14:48:16 +0800, wrote: > - Lots of checkpatch warnings, let's try to silent it. They are indentation issues, yes. They are already existing in slirp/ . Whenever new code was added we sticked with the qemu style, but for patched code we prefered to stick to the

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-07 Thread Samuel Thibault
Jason Wang, on Mon 07 Mar 2016 13:03:11 +0800, wrote: > Btw, do you want to be the maintainer of slirp? (Or maybe Tohmas want to > do this?) I already said I was fine with it, yes, and submitted a MAINTAINERS patch towards that, without any response. Samuel

Re: [Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-03-06 Thread Samuel Thibault
Hello, Jan Kiszka, on Fri 04 Mar 2016 16:50:32 +0100, wrote: > On 2016-03-04 09:41, Thomas Huth wrote: > > On 22.02.2016 20:28, Samuel Thibault wrote: > >> Hello, > >> > >> This is another respin of IPv6 in Qemu -net user mode. > >> > >> Thes

[Qemu-devel] [PATCH] Avoid embedding struct mbuf in other structures

2016-02-25 Thread Samuel Thibault
struct quehead, and use casts as appropriate. Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> --- slirp/if.c| 27 ++- slirp/mbuf.c | 19 ++- slirp/misc.c | 5 - slirp/

Re: [Qemu-devel] [PATCH] Avoid embedding struct mbuf in other structures

2016-02-25 Thread Samuel Thibault
Peter Maydell, on Thu 25 Feb 2016 15:22:25 +, wrote: > On 22 February 2016 at 21:29, Samuel Thibault > <samuel.thiba...@ens-lyon.org> wrote: > > struct mbuf uses a C99 open char array to allow inlining data. > > At the moment it doesn't, it uses a 1 byte array :-) T

[Qemu-devel] [PATCH] Avoid embedding struct mbuf in other structures

2016-02-22 Thread Samuel Thibault
as appropriate. Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/if.c| 27 ++- slirp/mbuf.c | 19 ++- slirp/misc.c | 5 - slirp/misc.h | 5 + slirp/slirp.h | 8 +--- 5 files changed, 34 insertions(+), 30 deletions(-)

[Qemu-devel] [PATCHv9 01/10] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-22 Thread Samuel Thibault
he RFC, to make the guest refresh its route. This also adds ip6_cksum() to compute ICMPv6 checksums using IPv6 pseudo-header. Some #define ETH_* are moved upper in slirp.h to make them accessible to other slirp/*.h Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Sam

[Qemu-devel] [PATCHv9 05/10] slirp: Generalizing and neutralizing various TCP functions before adding IPv6 stuff

2016-02-22 Thread Samuel Thibault
they are working on. This patch does not include the entailed reindentation, to make proofread easier. Reindentation is adressed in the following no-op patch. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: T

[Qemu-devel] [PATCHv9 04/10] slirp: Factorizing tcpiphdr structure with an union

2016-02-22 Thread Samuel Thibault
margin computation in various functions, and makes them compatible with the new tcpiphdr structure, whose size will be bigger than sizeof(struct tcphdr) + sizeof(struct ip) Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org&g

[Qemu-devel] [PATCHv9 07/10] slirp: Handle IPv6 in TCP functions

2016-02-22 Thread Samuel Thibault
; Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/ip6_input.c | 3 ++- slirp/tcp.h| 2 ++ slirp/tcp_input.c | 58 +++--- slirp/tcp_output.c | 16 +++

[Qemu-devel] [PATCHv9 09/10] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-02-22 Thread Samuel Thibault
ec0::3. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- net/net.c| 31 + net/slirp.c | 69 +++- qap

[Qemu-devel] [PATCHv9 02/10] slirp: Adding ICMPv6 error sending

2016-02-22 Thread Samuel Thibault
calls in various functions to send ICMP errors, when a received packet is too big, or when its hop limit is 0. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> ---

[Qemu-devel] [PATCHv9 08/10] slirp: Adding IPv6 address for DNS relay

2016-02-22 Thread Samuel Thibault
resses. For now this only points to localhost. Further development will be needed to automatically fetch the IPv6 address from resolv.conf, and announce this via RDNSS. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org>

[Qemu-devel] [PATCHv9 06/10] slirp: Reindent after refactoring

2016-02-22 Thread Samuel Thibault
From: Guillaume Subiron <maet...@subiron.org> No code change. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> ---

[Qemu-devel] [PATCHv9 10/10] slirp: Add IPv6 support to the TFTP code

2016-02-22 Thread Samuel Thibault
th <th...@redhat.com> Reviewed-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/tftp.c | 133 +-- slirp/tftp.h | 7 ++-- slirp/udp.c | 16 --- slirp/udp6.c | 16 +-- 4 files changed, 100 insertions(+), 72 deletions(-)

[Qemu-devel] [PATCHv9 0/10] slirp: Adding IPv6 support to Qemu -net user mode

2016-02-22 Thread Samuel Thibault
Hello, This is another respin of IPv6 in Qemu -net user mode. These patches add ICMPv6, NDP, make UDP and TCP compatible with IPv6, and add TFTP over IPv6. Difference with version 8 is: - Fix freeing random number generator - Fix coding style - Fix prefix lengths in in6_equal_dns macro Here

[Qemu-devel] [PATCHv9 03/10] slirp: Adding IPv6 UDP support

2016-02-22 Thread Samuel Thibault
<maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/Makefile.objs | 2 +- slirp/ip6_input.c | 2 +- slirp/socket.c | 5 ++ slirp/socket.h | 6 ++ slirp/udp.h | 5 ++ s

Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union

2016-02-22 Thread Samuel Thibault
Hello, Thomas Huth, on Mon 22 Feb 2016 08:56:59 +0100, wrote: > would it maybe be applicable to use the > TCPIPHDR_DELTA macro here instead? No, because that includes a round up, while here we need an exact difference. Samuel

Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union

2016-02-21 Thread Samuel Thibault
Hello, Thomas Huth, on Fri 19 Feb 2016 14:44:59 +0100, wrote: > > + m->m_data -= sizeof(struct tcpiphdr) - (sizeof(struct ip) > > ++ sizeof(struct tcphdr)); > > + m->m_len += sizeof(struct tcpiphdr) - (sizeof(struct ip) > > +

Re: [Qemu-devel] [PULL 00/13] vhost, virtio, pci, pxe

2016-02-19 Thread Samuel Thibault
Hello, Peter Maydell, on Fri 19 Feb 2016 12:09:17 +, wrote: > We can do that, I think, by updating slirp to use C99 flexible > arrays: Indeed. > diff --git a/slirp/mbuf.h b/slirp/mbuf.h > index 38fedf4..ef5a4f7 100644 > --- a/slirp/mbuf.h > +++ b/slirp/mbuf.h > @@ -81,11 +81,9 @@ struct

Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union

2016-02-18 Thread Samuel Thibault
Hello, Just to make sure: we have not received comments on this patch. (that said, it's the most complex part of the series, so I'm not surprised if it takes more time :) ) Samuel Samuel Thibault, on Sun 14 Feb 2016 18:47:38 +0100, wrote: > From: Guillaume Subiron <maet...@subir

Re: [Qemu-devel] [PATCHv7 9/9] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-02-18 Thread Samuel Thibault
Thomas Huth, on Wed 17 Feb 2016 12:59:04 +0100, wrote: > The IPv4 code seems to have a sanity check that the vhost address is > within the same net as specified with the "net=" parameter... maybe the > IPv6 part should have that, too? Or use the prefix from "ip6-net=" here > if ip6-host has not

Re: [Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay

2016-02-18 Thread Samuel Thibault
Samuel Thibault, on Wed 17 Feb 2016 10:36:35 +0100, wrote: > That's now like this in my tree: > > diff --git a/slirp/ip6.h b/slirp/ip6.h > index 9f7623f..9e4844e 100644 > --- a/slirp/ip6.h > +++ b/slirp/ip6.h > @@ -70,7 +70,11 @@ static inline bool in6_equal_mach(

Re: [Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay

2016-02-17 Thread Samuel Thibault
Thomas Huth, on Wed 17 Feb 2016 10:28:26 +0100, wrote: > On 14.02.2016 18:47, Samuel Thibault wrote: > > From: Guillaume Subiron <maet...@subiron.org> > > > > This patch adds an IPv6 address to the DNS relay. in6_equal_dns() is > > developed using this Slirp

Re: [Qemu-devel] [PATCHv7 7/9] slirp: Handle IPv6 in TCP functions

2016-02-17 Thread Samuel Thibault
Thomas Huth, on Wed 17 Feb 2016 10:18:20 +0100, wrote: > > @@ -204,6 +218,20 @@ tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, > > struct mbuf *m, > > (void) ip_output((struct socket *)0, m); > > break; > > > > + case AF_INET6: > > + m->m_data += sizeof(struct

Re: [Qemu-devel] [PATCH v2] slirp: Add IPv6 support to the TFTP code

2016-02-17 Thread Samuel Thibault
; > Signed-off-by: Thomas Huth <th...@redhat.com> Reviewed-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> > --- > v2: Changes according to the review of Samuel Thibault: > - Use the "slirp" parameter as the first parameter > - Use structure assignments in

Re: [Qemu-devel] [PATCH] slirp: Add IPv6 support to the TFTP code

2016-02-16 Thread Samuel Thibault
Hello, Thanks for working on it :) Thomas Huth, on Tue 16 Feb 2016 09:47:38 +0100, wrote: > -static int tftp_session_allocate(Slirp *slirp, struct tftp_t *tp) > +static int tftp_session_allocate(struct sockaddr_storage *srcsas, Slirp > *slirp, > + struct tftp_t

[Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay

2016-02-14 Thread Samuel Thibault
resses. For now this only points to localhost. Further development will be needed to automatically fetch the IPv6 address from resolv.conf, and announce this via RDNSS. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org>

[Qemu-devel] [PATCHv7 6/9] slirp: Reindent after refactoring

2016-02-14 Thread Samuel Thibault
From: Guillaume Subiron <maet...@subiron.org> No code change. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/tcp_input.c | 92 +++--- slirp

[Qemu-devel] [PATCHv7 7/9] slirp: Handle IPv6 in TCP functions

2016-02-14 Thread Samuel Thibault
; Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/ip6_input.c | 3 ++- slirp/tcp.h| 2 ++ slirp/tcp_input.c | 60 +++--- slirp/tcp_output.c | 16 +++ slirp/tcp_subr.c | 30

[Qemu-devel] [PATCHv7 2/9] slirp: Adding ICMPv6 error sending

2016-02-14 Thread Samuel Thibault
calls in various functions to send ICMP errors, when a received packet is too big, or when its hop limit is 0. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slir

[Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union

2016-02-14 Thread Samuel Thibault
margin computation in various functions, and makes them compatible with the new tcpiphdr structure, whose size will be bigger than sizeof(struct tcphdr) + sizeof(struct ip) Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org&g

[Qemu-devel] [PATCHv8 0/9] slirp: Adding IPv6 support to Qemu -net user mode

2016-02-14 Thread Samuel Thibault
Hello, This is another respin of IPv6 in Qemu -net user mode. These patches add ICMPv6, NDP, and make UDP and TCP compatible with IPv6. Difference with version 7 is: - Fix overflow detection in strtol call - Fix formatting and typos - Use SLIRP_ prefix for header protection - Use grand

[Qemu-devel] [PATCHv7 3/9] slirp: Adding IPv6 UDP support

2016-02-14 Thread Samuel Thibault
<maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/Makefile.objs | 2 +- slirp/ip6_input.c | 2 +- slirp/socket.c | 5 ++ slirp/socket.h | 6 ++ slirp/udp.h | 5 ++ slirp/u

[Qemu-devel] [PATCHv7 9/9] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-02-14 Thread Samuel Thibault
ec0::3. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- net/net.c| 31 +++ net/slirp.c | 50 -- qap

[Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-14 Thread Samuel Thibault
he RFC, to make the guest refresh its route. This also adds ip6_cksum() to compute ICMPv6 checksums using IPv6 pseudo-header. Some #define ETH_* are moved upper in slirp.h to make them accessible to other slirp/*.h Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Sam

[Qemu-devel] [PATCHv7 5/9] slirp: Generalizing and neutralizing various TCP functions before adding IPv6 stuff

2016-02-14 Thread Samuel Thibault
they are working on. This patch does not include the entailed reindentation, to make proofread easier. Reindentation is adressed in the following no-op patch. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp

Re: [Qemu-devel] [PATCHv7 6/9] slirp: Reindent after refactoring

2016-02-11 Thread Samuel Thibault
Eric Blake, on Thu 11 Feb 2016 10:56:30 -0700, wrote: > On 02/10/2016 02:20 AM, Samuel Thibault wrote: > > Thomas Huth, on Wed 10 Feb 2016 09:42:04 +0100, wrote: > >> On 08.02.2016 11:28, Samuel Thibault wrote: > >>> Signed-off-by: Guillaume Subiron <maet

Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union

2016-02-10 Thread Samuel Thibault
That one is tricky, yes :) Thomas Huth, on Wed 10 Feb 2016 09:05:32 +0100, wrote: > > -#define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + offsetof(struct mbuf, m_dat) > > + 6) > > +#define SLIRP_MSIZE\ > > +(offsetof(struct mbuf, m_dat) + IF_MAXLINKHDR + TCPIPHDR_DELTA + > > IF_MTU) > > I'm

Re: [Qemu-devel] [PATCHv7 5/9] slirp: Generalizing and neutralizing various TCP functions before adding IPv6 stuff

2016-02-10 Thread Samuel Thibault
Thomas Huth, on Wed 10 Feb 2016 09:35:31 +0100, wrote: > Hmm, this jumps to a "return (error)" statement ... but as far as I can > see, error has never been initialized in this case? Actually those places are unreachable (the address family can only be INET at this point, and only INET or INET6

Re: [Qemu-devel] [PATCHv7 6/9] slirp: Reindent after refactoring

2016-02-10 Thread Samuel Thibault
Thomas Huth, on Wed 10 Feb 2016 09:42:04 +0100, wrote: > On 08.02.2016 11:28, Samuel Thibault wrote: > > Signed-off-by: Guillaume Subiron <maet...@subiron.org> > > Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> > >

Re: [Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union

2016-02-10 Thread Samuel Thibault
Thomas Huth, on Wed 10 Feb 2016 11:08:55 +0100, wrote: > On 10.02.2016 10:28, Samuel Thibault wrote: > > Thomas Huth, on Wed 10 Feb 2016 09:05:32 +0100, wrote: > >>> -#define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + offsetof(struct mbuf, > >>> m_dat

Re: [Qemu-devel] [PATCHv7 7/9] slirp: Handle IPv6 in TCP functions

2016-02-10 Thread Samuel Thibault
Thomas Huth, on Wed 10 Feb 2016 11:47:05 +0100, wrote: > > + ip = mtod(m, struct ip *); > > + ip6 = mtod(m, struct ip6 *); > > + save_ip = *ip; > > + save_ip6 = *ip6; > > Could you do the "save_ip = *ip" within the "case AF_INET" below, and > the "save_ip6 = *ip6" within the case AF_INET6

Re: [Qemu-devel] [PATCHv7 9/9] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-02-10 Thread Samuel Thibault
Thomas Huth, on Wed 10 Feb 2016 12:39:10 +0100, wrote: > > +if (!vprefix6) { > > +vprefix6 = "fec0::"; > > Site-local prefixes have already been deprecated (see rfc3879) ... would > it be feasible to use a ULA prefix instead (fd00::/8, > see rfc4193) ? The question is which ULA.

Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-09 Thread Samuel Thibault
Thomas Huth, on Tue 09 Feb 2016 17:14:15 +0100, wrote: > > +srand(time(NULL)); > > That srand should maybe be done in main() instead? (Otherwise every > subsystem might end up in repeating this all over the place) Eric Blake added: > >> +#define rand_a_b(a, b)\ > >> +

Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-09 Thread Samuel Thibault
Thomas Huth, on Tue 09 Feb 2016 20:32:49 +0100, wrote: > Maybe checkpatch.pl could also be silenced by putting the "==" at the > end of the first line instead? No, it still warns. Samuel

Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-09 Thread Samuel Thibault
Thomas Huth, on Tue 09 Feb 2016 17:14:15 +0100, wrote: > > +return (a.s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8))) > > +== (b.s6_addr[prefix_len / 8] >> (8 - (prefix_len % 8))); > > checkpatch.pl complains here: > > ERROR: return is not a function, parentheses are not required

Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-09 Thread Samuel Thibault
Eric Blake, on Tue 09 Feb 2016 09:31:30 -0700, wrote: > >> +++ b/slirp/ip6_icmp.c > >> @@ -0,0 +1,350 @@ > >> +/* > >> + * Copyright (c) 2013 > > Want to add 2016? Well, nothing copyrightable has happened to these files since 2013... Samuel

Re: [Qemu-devel] [PATCHv7 3/9] slirp: Adding IPv6 UDP support

2016-02-09 Thread Samuel Thibault
Thanks for your reviews so far! I have integrated the rest of comments, the only remaining question for patches 1-3 is about srand() and rand(). Samuel

Re: [Qemu-devel] [PATCHv7 3/9] slirp: Adding IPv6 UDP support

2016-02-09 Thread Samuel Thibault
Thomas Huth, on Tue 09 Feb 2016 21:44:18 +0100, wrote: > > + case AF_INET6: > > + udp6_output(so, m, (struct sockaddr_in6 *) , > > + (struct sockaddr_in6 *) ); > > + break; > > default: > > + g_assert_not_reached(); > > Could this

Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-09 Thread Samuel Thibault
Thomas Huth, on Tue 09 Feb 2016 17:14:15 +0100, wrote: > A lot of these defines seem to be define in already > (as recommended by RFC 3542) ... would it be feasible to use that > standard header, instead of redefining here everything? I'm wondering how widely available that is. On windows, for

Re: [Qemu-devel] [PATCHv7 3/9] slirp: Adding IPv6 UDP support

2016-02-09 Thread Samuel Thibault
Thomas Huth, on Wed 10 Feb 2016 08:18:45 +0100, wrote: > On 09.02.2016 22:19, Samuel Thibault wrote: > > Thanks for your reviews so far! I have integrated the rest of comments, > > the only remaining question for patches 1-3 is about srand() and rand(). > > I personally d

[Qemu-devel] [PATCHv7 0/9] slirp: Adding IPv6 support to Qemu -net user mode

2016-02-08 Thread Samuel Thibault
Hello, This is another respin of IPv6 in Qemu -net user mode. These patches add ICMPv6, NDP, and make UDP and TCP compatible with IPv6. Difference with version 6 is: - drop second-precision timer addition - use ms precision for RA timer - Use unsigned short instead of sa_family_t - Use

[Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2016-02-08 Thread Samuel Thibault
he RFC, to make the guest refresh its route. This also adds ip6_cksum() to compute ICMPv6 checksums using IPv6 pseudo-header. Some #define ETH_* are moved upper in slirp.h to make them accessible to other slirp/*.h Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Sam

[Qemu-devel] [PATCHv7 6/9] slirp: Reindent after refactoring

2016-02-08 Thread Samuel Thibault
From: Guillaume Subiron <maet...@subiron.org> No code change. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/tcp_input.c | 99 +++--- slirp

[Qemu-devel] [PATCHv7 5/9] slirp: Generalizing and neutralizing various TCP functions before adding IPv6 stuff

2016-02-08 Thread Samuel Thibault
they are working on. This patch does not include the entailed reindentation, to make proofread easier. Reindentation is adressed in the following no-op patch. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp

[Qemu-devel] [PATCHv7 2/9] slirp: Adding ICMPv6 error sending

2016-02-08 Thread Samuel Thibault
calls in various functions to send ICMP errors, when a received packet is too big, or when its hop limit is 0. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slir

[Qemu-devel] [PATCHv7 3/9] slirp: Adding IPv6 UDP support

2016-02-08 Thread Samuel Thibault
<maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/Makefile.objs | 2 +- slirp/ip6_input.c | 2 +- slirp/socket.c | 5 ++ slirp/socket.h | 6 +++ slirp/udp.h | 5 ++ slirp/u

[Qemu-devel] [PATCHv7 7/9] slirp: Handle IPv6 in TCP functions

2016-02-08 Thread Samuel Thibault
; Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- slirp/ip6_input.c | 3 ++- slirp/tcp.h| 2 ++ slirp/tcp_input.c | 60 ++ slirp/tcp_output.c | 16 +++ slirp/tcp_subr.c | 33 +++

[Qemu-devel] [PATCHv7 8/9] slirp: Adding IPv6 address for DNS relay

2016-02-08 Thread Samuel Thibault
resses. For now this only points to localhost. Further development will be needed to automatically fetch the IPv6 address from resolv.conf, and announce this via RDNSS. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org>

[Qemu-devel] [PATCHv7 4/9] slirp: Factorizing tcpiphdr structure with an union

2016-02-08 Thread Samuel Thibault
margin computation in various functions, and makes them compatible with the new tcpiphdr structure, whose size will be bigger than sizeof(struct tcphdr) + sizeof(struct ip) Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org&g

[Qemu-devel] [PATCHv7 9/9] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2016-02-08 Thread Samuel Thibault
ec0::3. Signed-off-by: Yann Bordenave <m...@meowstars.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> --- net/net.c| 31 +++ net/slirp.c | 50 -- qap

Re: [Qemu-devel] [PULL 00/17] Net patches

2016-02-03 Thread Samuel Thibault
Jason Wang, on Wed 03 Feb 2016 12:52:24 +0800, wrote: > > Hi. I'm afraid this failed to build on w32: > > > > declaration specifiers or ‘...’ before ‘sa_family_t’ > > - switch to use unsigned short > - or typedef sa_family_t as unsigned short for windows Doing the second runs the risk of windows

Re: [Qemu-devel] [PATCHv7 0/9] slirp: Adding IPv6 support to Qemu -net user mode

2016-01-11 Thread Samuel Thibault
Hello, Samuel Thibault, on Sat 19 Dec 2015 22:24:40 +0100, wrote: > This is another respin of IPv6 in Qemu -net user mode. > > The following patches first make some refactoring to make current code ready > for IPv6, and do not change the behavior. The actual

[Qemu-devel] [PATCH 5/9] slirp: Factorizing address translation

2015-12-19 Thread Samuel Thibault
accept(), which performs the address translation when a connection is established on the host for port forwarding: if it comes from localhost, the host virtual address is used instead. This prepares for IPv6 support. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Sam

[Qemu-devel] [PATCH 6/9] slirp: Factorizing and cleaning solookup()

2015-12-19 Thread Samuel Thibault
mplete socket list). This prepares for IPv6 support. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/socket.c| 37 -

[Qemu-devel] [PATCH 1/9] slirp: goto bad in udp_input if sosendto fails

2015-12-19 Thread Samuel Thibault
patch adds a goto bad to cut the execution of this function. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/udp.c | 1 + 1 file changed, 1 insertion(+) di

[Qemu-devel] [PATCH 2/9] slirp: Generalizing and neutralizing ARP code

2015-12-19 Thread Samuel Thibault
From: Guillaume Subiron <maet...@subiron.org> Basically, this patch replaces "arp" by "resolution" every time "arp" means "mac resolution" and not specifically ARP. This prepares for IPv6 support. Signed-off-by: Guillaume Subiron <ma

[Qemu-devel] [PATCH 9/9] slirp: Adding family argument to tcp_fconnect()

2015-12-19 Thread Samuel Thibault
From: Guillaume Subiron <maet...@subiron.org> This patch simply adds a sa_family_t argument to remove the hardcoded "AF_INET" in the call of qemu_socket(). This prepares for IPv6 support. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel Thibaul

[Qemu-devel] [PATCH 4/9] slirp: Make Socket structure IPv6 compatible

2015-12-19 Thread Samuel Thibault
isting code is assured. The ss_family field of sockaddr_storage is declared after each socket creation. The whole structure is also saved/restored when a Qemu session is saved/restored. This prepares for IPv6 support. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-of

[Qemu-devel] [PATCH 7/9] slirp: Add sockaddr_equal, make solookup family-agnostic

2015-12-19 Thread Samuel Thibault
; Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Thomas Huth <th...@redhat.com> --- slirp/socket.c| 21 ++--- slirp/socket.h| 22 +- slirp/tcp_input.c | 23 ++- slirp/udp.c | 10 +++

[Qemu-devel] [PATCH 8/9] slirp: Make udp_attach IPv6 compatible

2015-12-19 Thread Samuel Thibault
From: Guillaume Subiron <maet...@subiron.org> A sa_family_t is now passed in argument to udp_attach instead of using a hardcoded "AF_INET" to call qemu_socket(). This prepares for IPv6 support. Signed-off-by: Guillaume Subiron <maet...@subiron.org> Signed-off-by: Samuel

<    8   9   10   11   12   13   14   15   16   >