1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-19 15:33:56 +00:00

Don't forget to ntohs(sin.sin_port) (DUH!)

This commit is contained in:
Brian Somers 1997-12-22 02:28:18 +00:00
parent adbf9b6f86
commit 4401489a4a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31931

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: main.c,v 1.108 1997/12/17 21:21:47 brian Exp $
* $Id: main.c,v 1.109 1997/12/17 21:21:56 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@ -981,10 +981,10 @@ DoLoop(void)
LogPrintf(LogPHASE, "Connected to local client.\n");
break;
case AF_INET:
if (sin->sin_port < 1024) {
if (ntohs(sin->sin_port) < 1024) {
LogPrintf(LogALERT, "Rejected client connection from %s:%u"
"(invalid port number) !\n",
inet_ntoa(sin->sin_addr), sin->sin_port);
inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
close(wfd);
continue;
}