chiark
/
gitweb
/
~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Conditional compilation for @getnetbyname@, since Cygwin doesn't have
[fwd]
/
inet.c
diff --git
a/inet.c
b/inet.c
index a9a559e2200a8a57fafef1e561177ee9629d5669..f98c7fa59759f7e08e652b99c0b3770d7c777709 100644
(file)
--- a/
inet.c
+++ b/
inet.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: inet.c,v 1.
3 2000/08/01 17:5
9:56 mdw Exp $
+ * $Id: inet.c,v 1.
4 2002/01/13 14:4
9:56 mdw Exp $
*
* Protocol specific definitions for IPv4 sockets
*
*
* Protocol specific definitions for IPv4 sockets
*
@@
-29,6
+29,10
@@
/*----- 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.3 2000/08/01 17:59:56 mdw
* Switch over to using `size_t' for socket address lengths.
*
@@
-197,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));