Hi Tim, On Fri, Jul 27, 2018 at 06:46:13PM +0200, Tim Duesterhus wrote: > Willy, > > attached is an updated patch that: > > 1. Only converts the addresses to IPv6 if at least one of them is IPv6. > But it does not convert them to IPv4 if both of them can be converted to > IPv4. > 2. Does not copy the whole `struct connection`, but performs the conversion > inside > `make_proxy_line_v?`. > > I'm not sure whether I like this better than my first attempt at it. Proxy > protocol > v2 was rather easy to modify, but proxy protocol v1 required a complete > restructuring > to not create a new case for each of the 4 address combinations (44, 46, 64, > 66).
In my opinion the code resulting from this approach is cleaner and safer than the code it replaces. I've looked carefully at it (v1 and v2) and am fine with it. I personally prefer to use the unhandled case in the "else" part to avoid maintaining two sets of conditions but here it's fine because these conditions are easy enough to enumerate. Thus I'm merging it and backporting it to 1.8 since it also makes sense to address this issue there. Thanks! Willy

