Skip to content

Commit 5aeaf16

Browse files
committed
rpcapd: Fixup a few comments.
1 parent d71dab8 commit 5aeaf16

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

rpcapd/fileconf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,11 @@ void fileconf_read(void)
333333
(unsigned int)(sizeof(activelist[num_active_clients].address) - 1));
334334
continue;
335335
}
336-
if (strcmp(port, "DEFAULT") == 0) // the user choose a custom port
336+
if (strcmp(port, "DEFAULT") == 0)
337+
// The default port.
337338
result = pcapint_strlcpy(activelist[num_active_clients].port, RPCAP_DEFAULT_NETPORT_ACTIVE, sizeof(activelist[num_active_clients].port));
338339
else
340+
// A custom port.
339341
result = pcapint_strlcpy(activelist[num_active_clients].port, port, sizeof(activelist[num_active_clients].port));
340342
if (result >= sizeof(activelist[num_active_clients].address))
341343
{

rpcapd/rpcapd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,17 @@ int main(int argc, char *argv[])
286286

287287
pcapint_strlcpy(activelist[i].address, tmpaddress, sizeof (activelist[i].address));
288288

289-
if ((tmpport == NULL) || (strcmp(tmpport, "DEFAULT") == 0)) // the user choose a custom port
289+
if ((tmpport == NULL) || (strcmp(tmpport, "DEFAULT") == 0))
290+
// The default port.
290291
pcapint_strlcpy(activelist[i].port, RPCAP_DEFAULT_NETPORT_ACTIVE, sizeof (activelist[i].port));
291292
else
293+
// A custom port.
292294
pcapint_strlcpy(activelist[i].port, tmpport, sizeof (activelist[i].port));
293295

294296
tmpaddress = pcapint_strtok_r(NULL, RPCAP_HOSTLIST_SEP, &lasts);
295297

296298
i++;
297299
}
298-
299300
if (i > MAX_ACTIVE_LIST)
300301
rpcapd_log(LOGPRIO_ERROR, "Only MAX_ACTIVE_LIST active connections are currently supported.");
301302

sockutils.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,10 +1701,10 @@ int sock_discard(PCAP_SOCKET sock, SSL *ssl, int size, char *errbuf,
17011701
*
17021702
* This function is useful after an accept() call in order to check if the connecting
17031703
* host is allowed to connect to me. To do that, we have a buffer that keeps the list of the
1704-
* allowed host; this function checks the sockaddr_storage structure of the connecting host
1704+
* allowed hosts; this function checks the sockaddr_storage structure of the connecting host
17051705
* against this host list, and it returns '0' is the host is included in this list.
17061706
*
1707-
* \param hostlist: pointer to a string that contains the list of the allowed host.
1707+
* \param hostlist: pointer to a string that contains the list of the allowed hosts.
17081708
*
17091709
* \param sep: a string that keeps the separators used between the hosts (for example the
17101710
* space character) in the host list.
@@ -1715,14 +1715,14 @@ int sock_discard(PCAP_SOCKET sock, SSL *ssl, int size, char *errbuf,
17151715
* error message. This buffer has to be at least 'errbuflen' in length.
17161716
* It can be NULL; in this case the error cannot be printed.
17171717
*
1718-
* \param errbuflen: length of the buffer that will contains the error. The error message cannot be
1718+
* \param errbuflen: length of the buffer that will contain the error. The error message cannot be
17191719
* larger than 'errbuflen - 1' because the last char is reserved for the string terminator.
17201720
*
17211721
* \return It returns:
17221722
* - '1' if the host list is empty
17231723
* - '0' if the host belongs to the host list (and therefore it is allowed to connect)
1724-
* - '-1' in case the host does not belong to the host list (and therefore it is not allowed to connect
1725-
* - '-2' in case or error. The error message is returned in the 'errbuf' variable.
1724+
* - '-1' in case the host does not belong to the host list (and therefore it is not allowed to connect)
1725+
* - '-2' in case of error. The error message is returned in the 'errbuf' variable.
17261726
*/
17271727
int sock_check_hostlist(const char *hostlist, const char *sep, struct sockaddr_storage *from, char *errbuf, int errbuflen)
17281728
{

0 commit comments

Comments
 (0)