check for conflicting *Port directives
Nick Mathewson
nickm at freehaven.net
Wed Jun 27 16:11:24 UTC 2007
On Sat, Jun 23, 2007 at 08:45:04PM +0100, Robert Hogan wrote:
>
> if someone does something like:
>
> ORPort 9031
> SocksPort 9031
>
> this will tell them where they've screwed up, rather than attempting
> to bind to the port and fail for the second of the two options.
>
> possibly a case of sledgehammer meets walnut (it's a large patch for
> what it's fixing). If the idea is right it will need some cleaning
> to be up to standard, but hopefully this will be less than the time
> required to write from scratch.
Hi, Robert! This is a good idea, but I think I see an issue with this
patch. It keeps you from doing stuff like the following, which _is_
legal:
ORPort 9031
SocksPort 9031
ORListenAddress 1.2.3.4
SocksListenAddress 127.0.0.1
And it doesn't stop you from doing stuff like this, which gives a port
conflict:
ORPort 9031
SocksPort 9032
ORListenAddress 0.0.0.0:9031
SocksListenAddress 127.0.0.1:9031
Minor issues to consider during the cleanup:
1) It doesn't pass make check-spaces.
2) It isn't indented like the rest of config.c.
3) It doesn't even come close to building under ./configure
--enable-gcc-warnings.
4) Consider using the smartlist mechanism for dynamically growing
arrays.
5) Port_add is probably misnamed; it doesn't add a port.
peace,
--
Nick Mathewson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20070627/dd0bef86/attachment.pgp>
More information about the tor-dev
mailing list