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