~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correctly cast uid and gid sentinel values.
[fwd]
/
inet.c
diff --git
a/inet.c
b/inet.c
index
7aa8e30
..
f98c7fa
100644
(file)
--- a/
inet.c
+++ b/
inet.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: inet.c,v 1.
2 1999/07/27 18:30:53
mdw Exp $
+ * $Id: inet.c,v 1.
4 2002/01/13 14:49:56
mdw Exp $
*
* Protocol specific definitions for IPv4 sockets
*
*
* Protocol specific definitions for IPv4 sockets
*
@@
-29,6
+29,13
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: inet.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: inet.c,v $
+ * Revision 1.4 2002/01/13 14:49:56 mdw
+ * Conditional compilation for @getnetbyname@, since Cygwin doesn't have
+ * it.
+ *
+ * Revision 1.3 2000/08/01 17:59:56 mdw
+ * Switch over to using `size_t' for socket address lengths.
+ *
* Revision 1.2 1999/07/27 18:30:53 mdw
* Various minor portability fixes.
*
* Revision 1.2 1999/07/27 18:30:53 mdw
* Various minor portability fixes.
*
@@
-194,9
+201,12
@@
static int inet_option(scanner *sc, addr_opts *ao)
if (sc->t == CTOK_WORD && strcmp(sc->d.buf, "from") == 0)
token(sc);
conf_name(sc, '.', &d);
if (sc->t == CTOK_WORD && strcmp(sc->d.buf, "from") == 0)
token(sc);
conf_name(sc, '.', &d);
+#ifdef HAVE_GETNETBYNAME
if ((n = getnetbyname(d.buf)) != 0)
a.s_addr = htonl(n->n_net);
if ((n = getnetbyname(d.buf)) != 0)
a.s_addr = htonl(n->n_net);
- else if ((h = gethostbyname(d.buf)) == 0)
+ else
+#endif
+ if ((h = gethostbyname(d.buf)) == 0)
error(sc, "couldn't resolve address `%s'", d.buf);
else
memcpy(&a, h->h_addr, sizeof(struct in_addr));
error(sc, "couldn't resolve address `%s'", d.buf);
else
memcpy(&a, h->h_addr, sizeof(struct in_addr));
@@
-244,7
+254,7
@@
static reffd *inet_accept(int fd, addr_opts *ao, const char *desc)
inet_opts *io = (inet_opts *)ao;
int nfd;
id_req q;
inet_opts *io = (inet_opts *)ao;
int nfd;
id_req q;
-
in
t lsinsz = sizeof(q.lsin), rsinsz = sizeof(q.rsin);
+
size_
t lsinsz = sizeof(q.lsin), rsinsz = sizeof(q.rsin);
/* --- Accept the new connection --- */
/* --- Accept the new connection --- */