Re: port forwarding trouble

This is a discussion on Re: port forwarding trouble within the OpenSSH Development forums, part of the Networking and Network Related category; * Darren Tucker [2005-08-11 00:35:10 +1000]: > It occurrs to me that since it doesn't actually ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-11-2005
Sergio Gelato
 
Posts: n/a
Default Re: port forwarding trouble

* Darren Tucker [2005-08-11 00:35:10 +1000]:
> It occurrs to me that since it doesn't actually need *parse* the
> host:port identifiers then factoring out that code is a waste of time,
> so this diff is much simpler :-)


Remind me: why do you need to check for the second ':' before deciding to
use square brackets? As far as avoiding ambiguity is concerned, I would
argue that even a single ':' in the host string is enough to warrant
bracketing.

It is true that an IPv6 address cannot be written with less than two ':'.
What I don't see right now is under what other circumstances host could
contain a single ':'. If, as I believe, it cannot, then you might as
well drop the second strchr() call. And even if it can, bracketing may
still be appropriate.

Isn't the reason for your two-':' heuristic that ListenAddress lines can
already be in host:port form? I don't think that's an issue here.

> + if ((p = strchr(host, ':')) != NULL && strchr(p+1, ':') != NULL)
> + ret = asprintf(&p, "[%s]:%hd", host, port); /* IPv6 */
> + else
> + ret = asprintf(&p, "%s:%hd", host, port);


_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://www.mindrot.org/mailman/listi...enssh-unix-dev
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:08 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0