Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2192?usp=email

to review the following change.


Change subject: socks: convert service port to host byte order
......................................................................

socks: convert service port to host byte order

getservbyname() returns s_port in network byte order, but the caller
splits the port as a host-order value. On little-endian hosts a remote
port given as a service name (e.g. "https") was sent byte-swapped in the
SOCKS5 CONNECT request.

Change-Id: Ic3e13e414b3c64cdafb57dcfe9d396159f8f5f44
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpn/socks.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/92/2192/1

diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c
index 51e3a1e..5cd6d8b 100644
--- a/src/openvpn/socks.c
+++ b/src/openvpn/socks.c
@@ -332,7 +332,7 @@
     const struct servent *service = getservbyname(servname, NULL);
     if (service)
     {
-        return service->s_port;
+        return ntohs((uint16_t)service->s_port);
     }

     return 0;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2192?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic3e13e414b3c64cdafb57dcfe9d396159f8f5f44
Gerrit-Change-Number: 2192
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to