X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-bsd.c;h=e4becf527ad2c32650a5035e4936c47ee2d61c94;hb=ac19750e0fb64986870e9bd9bad52d5ae46e2551;hp=22ba04dbd3c6269e4f459019b9833eb682244410;hpb=b03e0f44811d84b0be229b0f8498b275d0b2e386;p=ppp.git diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index 22ba04d..e4becf5 100644 --- a/pppd/sys-bsd.c +++ b/pppd/sys-bsd.c @@ -21,8 +21,9 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-bsd.c,v 1.30 1998/03/25 02:19:26 paulus Exp $"; +static char rcsid[] = "$Id: sys-bsd.c,v 1.35 1999/03/08 01:46:21 paulus Exp $"; /* $NetBSD: sys-bsd.c,v 1.1.1.3 1997/09/26 18:53:04 christos Exp $ */ +#endif /* * TODO: @@ -62,9 +63,13 @@ static char rcsid[] = "$Id: sys-bsd.c,v 1.30 1998/03/25 02:19:26 paulus Exp $"; #if defined(NetBSD) && (NetBSD >= 199703) #include #else /* NetBSD 1.2D or later */ +#ifdef __FreeBSD__ +#include +#else #include #endif #endif +#endif #include "pppd.h" #include "fsm.h" @@ -154,9 +159,16 @@ sys_close() /* * sys_check_options - check the options that the user specified */ -void +int sys_check_options() { +#ifndef CDTRCTS + if (crtscts == 2) { + syslog(LOG_WARNING, "DTR/CTS flow control is not supported on this system"); + return 0; + } +#endif + return 1; } /* @@ -380,10 +392,19 @@ set_up_tty(fd, local) } tios.c_cflag &= ~(CSIZE | CSTOPB | PARENB | CLOCAL); - if (crtscts > 0 && !local) - tios.c_cflag |= CRTSCTS; - else if (crtscts < 0) + if (crtscts > 0 && !local) { + if (crtscts == 2) { +#ifdef CDTRCTS + tios.c_cflag |= CDTRCTS; +#endif + } else + tios.c_cflag |= CRTSCTS; + } else if (crtscts < 0) { tios.c_cflag &= ~CRTSCTS; +#ifdef CDTRCTS + tios.c_cflag &= ~CDTRCTS; +#endif + } tios.c_cflag |= CS8 | CREAD | HUPCL; if (local || !modem) @@ -1055,7 +1076,7 @@ dodefaultroute(g, cmd) memset(&rtmsg, 0, sizeof(rtmsg)); rtmsg.hdr.rtm_type = cmd == 's'? RTM_ADD: RTM_DELETE; - rtmsg.hdr.rtm_flags = RTF_UP | RTF_GATEWAY; + rtmsg.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC; rtmsg.hdr.rtm_version = RTM_VERSION; rtmsg.hdr.rtm_seq = ++rtm_seq; rtmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; @@ -1389,6 +1410,17 @@ 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; +} + /* * Use the hostid as part of the random number seed. */