summaryrefslogtreecommitdiff
path: root/canohost.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-12-23 02:13:37 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-12-23 02:13:37 +0000
commitacaac975cad5a45c14da53f1e61e5c6d133de85d (patch)
treeea505053256052a430297ee17bbdf36211a3183f /canohost.c
parent9394d2fc0a3fed5cfca0bae0cb6dd8e4c1ee1e9d (diff)
- stevesk@cvs.openbsd.org 2002/11/26 02:38:54
[canohost.c] KNF, comment and error message repair; ok markus@
Diffstat (limited to 'canohost.c')
-rw-r--r--canohost.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/canohost.c b/canohost.c
index a457d3c52..9aa942a9f 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: canohost.c,v 1.34 2002/09/23 20:46:27 stevesk Exp $"); 15RCSID("$OpenBSD: canohost.c,v 1.35 2002/11/26 02:38:54 stevesk Exp $");
16 16
17#include "packet.h" 17#include "packet.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -38,7 +38,7 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
38 /* Get IP address of client. */ 38 /* Get IP address of client. */
39 fromlen = sizeof(from); 39 fromlen = sizeof(from);
40 memset(&from, 0, sizeof(from)); 40 memset(&from, 0, sizeof(from));
41 if (getpeername(socket, (struct sockaddr *) &from, &fromlen) < 0) { 41 if (getpeername(socket, (struct sockaddr *)&from, &fromlen) < 0) {
42 debug("getpeername failed: %.100s", strerror(errno)); 42 debug("getpeername failed: %.100s", strerror(errno));
43 fatal_cleanup(); 43 fatal_cleanup();
44 } 44 }
@@ -202,8 +202,8 @@ get_canonical_hostname(int verify_reverse_mapping)
202} 202}
203 203
204/* 204/*
205 * Returns the remote IP-address of socket as a string. The returned 205 * Returns the local/remote IP-address/hostname of socket as a string.
206 * string must be freed. 206 * The returned string must be freed.
207 */ 207 */
208static char * 208static char *
209get_socket_address(int socket, int remote, int flags) 209get_socket_address(int socket, int remote, int flags)
@@ -228,7 +228,7 @@ get_socket_address(int socket, int remote, int flags)
228 /* Get the address in ascii. */ 228 /* Get the address in ascii. */
229 if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), 229 if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop),
230 NULL, 0, flags) != 0) { 230 NULL, 0, flags) != 0) {
231 error("get_socket_ipaddr: getnameinfo %d failed", flags); 231 error("get_socket_address: getnameinfo %d failed", flags);
232 return NULL; 232 return NULL;
233 } 233 }
234 return xstrdup(ntop); 234 return xstrdup(ntop);
@@ -314,7 +314,7 @@ get_sock_port(int sock, int local)
314 return 0; 314 return 0;
315 } 315 }
316 } else { 316 } else {
317 if (getpeername(sock, (struct sockaddr *) & from, &fromlen) < 0) { 317 if (getpeername(sock, (struct sockaddr *)&from, &fromlen) < 0) {
318 debug("getpeername failed: %.100s", strerror(errno)); 318 debug("getpeername failed: %.100s", strerror(errno));
319 fatal_cleanup(); 319 fatal_cleanup();
320 } 320 }