From: Paul Mackerras Date: Wed, 25 Mar 1998 02:17:23 +0000 (+0000) Subject: Mods from Steve Perkins; add get_host_seed X-Git-Tag: RELEASE_2_3_6~105 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=3c87be2e9a1851cd47d7a6759ed9b491dae79678 Mods from Steve Perkins; add get_host_seed --- diff --git a/pppd/sys-NeXT.c b/pppd/sys-NeXT.c index ee2cece..8ab5a12 100644 --- a/pppd/sys-NeXT.c +++ b/pppd/sys-NeXT.c @@ -20,7 +20,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-NeXT.c,v 1.8 1997/04/30 05:57:14 paulus Exp $"; +static char rcsid[] = "$Id: sys-NeXT.c,v 1.9 1998/03/25 02:17:23 paulus Exp $"; #endif #include @@ -29,6 +29,7 @@ static char rcsid[] = "$Id: sys-NeXT.c,v 1.8 1997/04/30 05:57:14 paulus Exp $"; #include #include #include +#include #include #include #include @@ -46,7 +47,10 @@ static char rcsid[] = "$Id: sys-NeXT.c,v 1.8 1997/04/30 05:57:14 paulus Exp $"; #include #include #include +#if !(NS_TARGET >= 40) +/* XXX get an error "duplicate member ip_v under 4.1 GAMMA */ #include +#endif /* NS_TARGET */ #include #include #include @@ -70,6 +74,7 @@ static struct termios inittermios; /* Initial TTY termios */ static char *lock_file; static int sockfd; /* socket for doing interface ioctls */ +static int pppdev; /* +++ */ #if defined(i386) && defined(HAS_BROKEN_IOCTL) #define ioctl myioctl @@ -101,6 +106,13 @@ sys_init() syslog(LOG_ERR, "Couldn't create IP socket: %m"); die(1); } + + if((pppdev = open("/dev/ppp0", O_RDWR, O_NONBLOCK)) == NULL) + { + syslog(LOG_ERR, "Couldn't open /dev/ppp0: %m"); + die(1); + } + } /* @@ -126,6 +138,8 @@ sys_cleanup() cifdefaultroute(0, 0, default_route_gateway); if (proxy_arp_addr) cifproxyarp(0, proxy_arp_addr); + + close(pppdev); } /* @@ -1609,6 +1623,16 @@ restore_loop() } +/* + * Use the hostid as part of the random number seed. + */ +int +get_host_seed() +{ + return gethostid(); +} + + /* * sys_check_options - check the options that the user specified */