You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Chris Reynolds <sh...@gmail.com> on 2011/08/23 17:09:31 UTC

TSNetConnect now takes host byte ordered port number

Hi,

The trunk code version of TSNetConnect now seems to take a host byte ordered
port number. Previously (i.e. 3.0.0) took the network byte order. I.e. I now
have to use the ntohs function on the port number.

Is this by design?

Thank-you,

Chris Reynolds.

Re: TSNetConnect now takes host byte ordered port number

Posted by "Alan M. Carroll" <am...@network-geographics.com>.
I think it should be OK. It uses ink_inet_port_cast which extracts the port without changing byte order. TSNetConnect used ink_inet_get_port which flips the byte order. I think I will add it to the patch to not bother to extract the address and port (that was needed before the changes in 3.1.0).

Tuesday, August 23, 2011, 4:57:05 PM, you wrote:

> After looking at 3.1.0, is it possible that TSFetchUrl might also have
> the same problem?



Re: TSNetConnect now takes host byte ordered port number

Posted by Brian Geffon <br...@gmail.com>.
After looking at 3.1.0, is it possible that TSFetchUrl might also have
the same problem?


On Tue, Aug 23, 2011 at 9:48 AM, Alan M. Carroll
<am...@network-geographics.com> wrote:
> Because of the change over to IPv6 in the internals, ports are stored differently. Let me take a look ...
>
> Yeah, that's a bug introduced by the change. A quick fix is to change InkAPI.cc:6196 from
>
> return (TSAction)netProcessor.connect_re(i, ip, port);
>
> to
>
> return (TSAction)netProcessor.connect_re(i, addr);
>
> I'll file a bug and fix it and we can decide if we want to backport to 3.1.0.
>
> Tuesday, August 23, 2011, 10:09:31 AM, you wrote:
>
>> Hi,
>
>> The trunk code version of TSNetConnect now seems to take a host byte ordered
>> port number. Previously (i.e. 3.0.0) took the network byte order. I.e. I now
>> have to use the ntohs function on the port number.
>
>> Is this by design?
>
>> Thank-you,
>
>> Chris Reynolds.
>
>

Re: TSNetConnect now takes host byte ordered port number

Posted by "Alan M. Carroll" <am...@network-geographics.com>.
Because of the change over to IPv6 in the internals, ports are stored differently. Let me take a look ...

Yeah, that's a bug introduced by the change. A quick fix is to change InkAPI.cc:6196 from

return (TSAction)netProcessor.connect_re(i, ip, port);

to

return (TSAction)netProcessor.connect_re(i, addr);

I'll file a bug and fix it and we can decide if we want to backport to 3.1.0.

Tuesday, August 23, 2011, 10:09:31 AM, you wrote:

> Hi,

> The trunk code version of TSNetConnect now seems to take a host byte ordered
> port number. Previously (i.e. 3.0.0) took the network byte order. I.e. I now
> have to use the ntohs function on the port number.

> Is this by design?

> Thank-you,

> Chris Reynolds.