/* -*-c-*-
*
- * $Id: inet.c,v 1.3 2000/08/01 17:59:56 mdw Exp $
+ * $Id: inet.c,v 1.4 2002/01/13 14:49:56 mdw Exp $
*
* Protocol specific definitions for IPv4 sockets
*
/*----- 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.
*
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);
- 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));