[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/18] slirp: Factorizing and cleaning solookup(
From: |
Samuel Thibault |
Subject: |
Re: [Qemu-devel] [PATCH 06/18] slirp: Factorizing and cleaning solookup() |
Date: |
Fri, 11 Dec 2015 20:38:19 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Samuel Thibault, on Fri 11 Dec 2015 20:29:44 +0100, wrote:
> Thomas Huth, on Fri 11 Dec 2015 16:06:22 +0100, wrote:
> > On 11/12/15 01:15, Samuel Thibault wrote:
> > > From: Guillaume Subiron <address@hidden>
> > >
> > > This patch makes solookup() compatible with varying address families.
> > > Also,
> > > this function was only compatible with TCP. Having the socket list in
> > > argument, it is now compatible with UDP too. Finally, some optimization
> > > code is factorized inside the function (the function look at the last
> > > returned result before browsing the complete socket list).
> > >
> > > This also adds a sockaddr_equal() function to compare two
> > > sockaddr_storage.
> >
> > I'd maybe also split this patch into two - first introduce the
> > sockaddr_equal() function, then do the other changes. If you do too much
> > stuff in one patch, it gets more difficult to read.
>
> Actually I think I'll do the converse. solookup doesn't take a sockaddr
> first, so introducing sockaddr_equal just to make it take separate
> in_addr and lport would make both patches clumsy. Making solookup access
> sockaddr first is however not too bad.
Mmm, that's still clumsy: making solookup use sockaddr_storage
without using solookup means putting all the casts there, it's really
unreadable, while the version with sockaddr_equal is nice to read. And
conversely, introducing sockaddr_equal first is clumsy.
I'll however have a look at introducing the optimizations etc. first, so
that both making solookup use sockaddr and introducing sockaddr_equal
looks natural.
Samuel
- Re: [Qemu-devel] [PATCH 08/18] slirp: Adding family argument to tcp_fconnect(), (continued)
- [Qemu-devel] [PATCH 15/18] slirp: Reindent after refactoring, Samuel Thibault, 2015/12/10
- [Qemu-devel] [PATCH 03/18] slirp: Reindent after refactoring, Samuel Thibault, 2015/12/10
- [Qemu-devel] [PATCH 18/18] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses, Samuel Thibault, 2015/12/10
- [Qemu-devel] [PATCH 10/18] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration, Samuel Thibault, 2015/12/10
- [Qemu-devel] [PATCH 04/18] slirp: Make Socket structure IPv6 compatible, Samuel Thibault, 2015/12/10
- [Qemu-devel] [PATCH 06/18] slirp: Factorizing and cleaning solookup(), Samuel Thibault, 2015/12/10
[Qemu-devel] [PATCH 02/18] slirp: Generalizing and neutralizing code before adding IPv6 stuff, Samuel Thibault, 2015/12/10
Re: [Qemu-devel] [PATCH 02/18] slirp: Generalizing and neutralizing code before adding IPv6 stuff, Thomas Huth, 2015/12/11
Re: [Qemu-devel] [PATCH 02/18] slirp: Generalizing and neutralizing code before adding IPv6 stuff, Samuel Thibault, 2015/12/11
Re: [Qemu-devel] [PATCH 02/18] slirp: Generalizing and neutralizing code before adding IPv6 stuff, Thomas Huth, 2015/12/11