On 01/10/15(Thu) 19:40, Vincent Gross wrote:
> Although the sysctls controlling the port range are labelled "port(hi)?first" 
> and
> "port(hi)?last", no ordering is enforced and you can have portfirst > 
> portlast.
> in_pcbbind() (and in6_pcbsetport()) work around this by duplicating the loop 
> looking
> for an available port.

What about a small regress test?

> This diff introduce temporary bounds and compare them to guarantee that
> first <= last, thus allowing deduplication of the port scan loop.

Makes sense to me, I'd keep the comment though.

> 
> Tested on my laptop with a narrow port range and heavy cheezburger browsing, 
> no fault
> detected. Deeper testing welcome.
> 
> Should I include in6_pcbsetport() changes right now or should ipv4 be 
> validated first ?

I prefer when both version are keep in sync, so yes a in6_pcbsetport()
diff would be nice.  Plus if it's possible to have a regress test it
would be awesome.

Reply via email to