From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVeRd-00087x-O0 for qemu-devel@nongnu.org; Tue, 16 Feb 2016 07:09:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVeRa-0004RF-Go for qemu-devel@nongnu.org; Tue, 16 Feb 2016 07:09:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVeRa-0004R3-AD for qemu-devel@nongnu.org; Tue, 16 Feb 2016 07:09:26 -0500 References: <1455612458-28274-1-git-send-email-thuth@redhat.com> <20160216103024.GD2823@var.bordeaux.inria.fr> From: Thomas Huth Message-ID: <56C31171.2020003@redhat.com> Date: Tue, 16 Feb 2016 13:09:21 +0100 MIME-Version: 1.0 In-Reply-To: <20160216103024.GD2823@var.bordeaux.inria.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] slirp: Add IPv6 support to the TFTP code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault Cc: jan.kiszka@siemens.com, jasowang@redhat.com, qemu-devel@nongnu.org On 16.02.2016 11:30, Samuel Thibault wrote: > 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 *tp) > > slirp is usually the first parameter, it'd probably be better to keep > this habit. Ok, I don't have a preference here, so I'll change it. >> -static int tftp_session_find(Slirp *slirp, struct tftp_t *tp) >> +static int tftp_session_find(struct sockaddr_storage *srcsas, Slirp *slirp, >> + struct tftp_t *tp) > > ditto. > >> +static void tftp_udp_output(struct tftp_session *spt, struct mbuf *m, >> + struct tftp_t *recv_tp) >> +{ >> + if (spt->client_addr.ss_family == AF_INET6) { >> + struct sockaddr_in6 sa6, da6; >> + >> + memcpy(&sa6.sin6_addr, spt->slirp->vhost_addr6.s6_addr, 16); > > Why not simply sa6.sin6_addr = spt->slirp->vhost_addr6? > > The compiler will optimize the structure assignment as an inline copy or > memcpy call as appropriate. That makes sense, too, I'll change it. Thanks for the review! Thomas