diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-22 02:18:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-22 02:18:45 +0000 |
commit | 59be703d9b85882d0d7b54471a68d9027051cf57 (patch) | |
tree | 130a0e29684ee55ba88f381ff0eff9f43c48d47a /lib | |
parent | 80eddc88a7f881b7952a49a23f25677f09e6b4ba (diff) |
randomize _res.id at start; could do better i hope
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; |