X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-NeXT.c;h=b42e0d191161f9d05d757a25cd3ebcf1ac1f4e0c;hb=ac19750e0fb64986870e9bd9bad52d5ae46e2551;hp=589504ab5812905c7387ada1fdd8f3b8db20db4b;hpb=46988c18b9d870c5c89f8c274a9062bd89598c23;p=ppp.git diff --git a/pppd/sys-NeXT.c b/pppd/sys-NeXT.c index 589504a..b42e0d1 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.7 1997/03/04 03:34:48 paulus Exp $"; +static char rcsid[] = "$Id: sys-NeXT.c,v 1.11 1999/03/08 01:46:19 paulus Exp $"; #endif #include @@ -29,6 +29,7 @@ static char rcsid[] = "$Id: sys-NeXT.c,v 1.7 1997/03/04 03:34:48 paulus Exp $"; #include #include #include +#include #include #include #include @@ -46,7 +47,10 @@ static char rcsid[] = "$Id: sys-NeXT.c,v 1.7 1997/03/04 03:34:48 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); } /* @@ -518,7 +532,7 @@ output(unit, p, len) int len; { if (debug) - log_packet(p, len, "sent "); + log_packet(p, len, "sent ", LOG_DEBUG); if (write(ttyfd, p, len) < 0) { if (errno == EWOULDBLOCK || errno == ENOBUFS @@ -1179,6 +1193,16 @@ GetMask(addr) return mask; } +/* + * have_route_to - determine if the system has any route to + * a given IP address. + * For demand mode to work properly, we have to ignore routes + * through our own interface. + */ +int have_route_to(u_int32_t addr) +{ + return -1; +} /* @@ -1609,20 +1633,31 @@ 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 */ -void +int sys_check_options() { /* * We don't support demand dialing yet. */ - if(demand) + if (demand) { syslog(LOG_WARNING, "PPP-2.3 for NeXTSTEP does not yet support demand dialing\n"); - demand = 0; + return 0; } + return 1; }