diff options
Diffstat (limited to 'lib/lwres/getipnode.c')
| -rw-r--r-- | lib/lwres/getipnode.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/lwres/getipnode.c b/lib/lwres/getipnode.c index fc5f6114..4fd66676 100644 --- a/lib/lwres/getipnode.c +++ b/lib/lwres/getipnode.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: getipnode.c,v 1.30.2.8 2005/04/28 23:59:13 marka Exp $ */ +/* $Id: getipnode.c,v 1.30.2.10 2007/06/18 23:45:27 tbox Exp $ */ #include <config.h> @@ -399,6 +399,9 @@ scan_interfaces(int *have_v4, int *have_v6) { static int bufsiz = 4095; int s, cpsize, n; +#ifdef WIN32 + InitSockets(); +#endif /* * Set to zero. Used as loop terminators below. */ @@ -519,13 +522,20 @@ scan_interfaces(int *have_v4, int *have_v6) { } if (buf != NULL) free(buf); +#ifdef WIN32 + DestroySockets(); +#endif close(s); return (0); + err_ret: if (buf != NULL) free(buf); if (s != -1) close(s); +#ifdef WIN32 + DestroySockets(); +#endif return (-1); #endif } |
