linamh/net-ftp/oftpd/files/oftpd-0.3.7-htons.patch

17 lines
458 B
Diff
Raw Normal View History

2020-01-23 11:57:54 +01:00
--- oftpd-0.3.7/src/ftp_listener.c
+++ oftpd-0.3.7/src/ftp_listener.c
@@ -159,11 +159,11 @@
switch (family) {
#ifdef INET6
case AF_INET6:
- ((struct sockaddr_in6*)&sock_addr)->sin6_port = port;
+ ((struct sockaddr_in6*)&sock_addr)->sin6_port = htons(port);
break;
#endif
case AF_INET:
- ((struct sockaddr_in*)&sock_addr)->sin_port = port;
+ ((struct sockaddr_in*)&sock_addr)->sin_port = htons(port);
break;
default:
/* handle error */