]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix v1 port parsing
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 22 Jun 2014 04:23:42 +0000 (21:23 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 22 Jun 2014 04:23:42 +0000 (21:23 -0700)
The original code avoiding ntohs() was correct.

src/client_side.cc

index 48c5d567f99d3689c3cfb4009b074ef4eaf03c01..57fe557c49740ba7a349d2268f50010b59f27b78 100644 (file)
@@ -3006,12 +3006,12 @@ ConnStateData::parseProxyProtocolMagic()
                 return false;
 
             if (porta > 0 && porta <= 0xFFFF) // max uint16_t
-                originalClient.port(ntohs(static_cast<uint16_t>(porta)));
+                originalClient.port(static_cast<uint16_t>(porta));
             else
                 return proxyProtocolError(true);
 
             if (portb > 0 && portb <= 0xFFFF) // max uint16_t
-                originalDest.port(ntohs(static_cast<uint16_t>(portb)));
+                originalDest.port(static_cast<uint16_t>(portb));
             else
                 return proxyProtocolError(true);