check for conflicting *Port directives

Nick Mathewson nickm at
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_

        ORPort 9031
        SocksPort 9031

And it doesn't stop you from doing stuff like this, which gives a port

        ORPort 9031
        SocksPort 9032

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
   4) Consider using the smartlist mechanism for dynamically growing
   5) Port_add is probably misnamed; it doesn't add a port.

Nick Mathewson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: not available
URL: <>

More information about the tor-dev mailing list