diff options
| author | provos <> | 1997-04-13 21:30:47 +0000 |
|---|---|---|
| committer | provos <> | 1997-04-13 21:30:47 +0000 |
| commit | 8748c1e58b42a18ddefc3a3c64dcef04f063fd73 (patch) | |
| tree | 0b205c7047810284d55a96e138cbef206efe861c /src/lib/libc/net/res_init.c | |
| parent | d4f803e80d72c0e5d6d296286646ccc5dc01c32d (diff) | |
| download | openbsd-8748c1e58b42a18ddefc3a3c64dcef04f063fd73.tar.gz openbsd-8748c1e58b42a18ddefc3a3c64dcef04f063fd73.tar.bz2 openbsd-8748c1e58b42a18ddefc3a3c64dcef04f063fd73.zip | |
the before mentioned random number generator.
Diffstat (limited to 'src/lib/libc/net/res_init.c')
| -rw-r--r-- | src/lib/libc/net/res_init.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/lib/libc/net/res_init.c b/src/lib/libc/net/res_init.c index a16c47807f..973fdd43be 100644 --- a/src/lib/libc/net/res_init.c +++ b/src/lib/libc/net/res_init.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: res_init.c,v 1.13 1997/04/05 21:13:17 millert Exp $ */ | 1 | /* $OpenBSD: res_init.c,v 1.14 1997/04/13 21:30:43 provos Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * ++Copyright++ 1985, 1989, 1993 | 4 | * ++Copyright++ 1985, 1989, 1993 |
| @@ -60,7 +60,7 @@ | |||
| 60 | static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; | 60 | static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; |
| 61 | static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $"; | 61 | static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $"; |
| 62 | #else | 62 | #else |
| 63 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.13 1997/04/05 21:13:17 millert Exp $"; | 63 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.14 1997/04/13 21:30:43 provos Exp $"; |
| 64 | #endif | 64 | #endif |
| 65 | #endif /* LIBC_SCCS and not lint */ | 65 | #endif /* LIBC_SCCS and not lint */ |
| 66 | 66 | ||
| @@ -185,13 +185,6 @@ res_init() | |||
| 185 | if (!(_res.options & RES_INIT)) | 185 | if (!(_res.options & RES_INIT)) |
| 186 | _res.options = RES_DEFAULT; | 186 | _res.options = RES_DEFAULT; |
| 187 | 187 | ||
| 188 | /* | ||
| 189 | * This one used to initialize implicitly to zero, so unless the app | ||
| 190 | * has set it to something in particular, we can randomize it now. | ||
| 191 | */ | ||
| 192 | if (!_res.id) | ||
| 193 | _res.id = res_randomid(); | ||
| 194 | |||
| 195 | #ifdef USELOOPBACK | 188 | #ifdef USELOOPBACK |
| 196 | _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); | 189 | _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); |
| 197 | #else | 190 | #else |
| @@ -510,9 +503,3 @@ net_mask(in) /* XXX - should really use system's version of this */ | |||
| 510 | return (htonl(IN_CLASSC_NET)); | 503 | return (htonl(IN_CLASSC_NET)); |
| 511 | } | 504 | } |
| 512 | #endif | 505 | #endif |
| 513 | |||
| 514 | u_int | ||
| 515 | res_randomid() | ||
| 516 | { | ||
| 517 | return (0xffff & arc4random()); | ||
| 518 | } | ||
