diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/res_init.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c index 355c9ce1b0f..85e0c8211ea 100644 --- a/lib/libc/net/res_init.c +++ b/lib/libc/net/res_init.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: res_init.c,v 1.7 1996/09/15 09:31:19 tholo Exp $"; +static char rcsid[] = "$OpenBSD: res_init.c,v 1.8 1996/09/22 02:18:44 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -68,6 +68,7 @@ static char rcsid[] = "$OpenBSD: res_init.c,v 1.7 1996/09/15 09:31:19 tholo Exp static void res_setoptions __P((char *, char *)); static u_int32_t net_mask __P((struct in_addr)); +static u_int16_t res_randomid __P((void)); /* * Resolver state default settings @@ -113,6 +114,9 @@ res_init() int havesearch = 0; int nsort = 0; + if (_res.id == 0) + _res.id = res_randomid(); + _res.nsaddr.sin_len = sizeof(struct sockaddr_in); _res.nsaddr.sin_family = AF_INET; _res.nsaddr.sin_port = htons(NAMESERVER_PORT); @@ -403,8 +407,8 @@ net_mask(in) /* XXX - should really use system's version of this */ return (htonl(IN_CLASSC_NET)); } -u_int16_t -res_randomid() +static u_int16_t +__res_randomid() { struct timeval now; |