From d350bee6928479a18c9351818c55ceed53fd6dba Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 14 May 1999 01:09:04 +0000 Subject: [PATCH] don't turn on IP if we can't do IPX --- pppd/options.c | 6 +++++- pppd/pppd.h | 10 +++++----- pppd/sys-linux.c | 24 ++++++++++-------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pppd/options.c b/pppd/options.c index 4976376..495c29a 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: options.c,v 1.58 1999/05/12 06:19:48 paulus Exp $"; +static char rcsid[] = "$Id: options.c,v 1.59 1999/05/14 01:09:03 paulus Exp $"; #endif #include @@ -108,6 +108,10 @@ struct bpf_program active_filter; /* Filter program for link-active pkts */ pcap_t pc; /* Fake struct pcap so we can compile expr */ #endif +char *current_option; /* the name of the option being parsed */ +int privileged_option; /* set iff the current option came from root */ +char *option_source; /* string saying where the option came from */ + /* * Prototypes */ diff --git a/pppd/pppd.h b/pppd/pppd.h index 4b6dbf2..a95f461 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: pppd.h,v 1.40 1999/05/13 00:34:33 paulus Exp $ + * $Id: pppd.h,v 1.41 1999/05/14 01:09:03 paulus Exp $ */ /* @@ -193,15 +193,15 @@ extern struct bpf_program pass_filter; /* Filter for pkts to pass */ extern struct bpf_program active_filter; /* Filter for link-active pkts */ #endif -char *current_option; /* the name of the option being parsed */ -int privileged_option; /* set iff the current option came from root */ -char *option_source; /* string saying where the option came from */ - #ifdef MSLANMAN extern bool ms_lanman; /* Use LanMan password instead of NT */ /* Has meaning only with MS-CHAP challenges */ #endif +extern char *current_option; /* the name of the option being parsed */ +extern int privileged_option; /* set iff the current option came from root */ +extern char *option_source; /* string saying where the option came from */ + /* * Values for phase. */ diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 94c31dd..0537e49 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -1024,7 +1024,7 @@ static int read_route_table (struct rtentry *rt); * path_to_procfs - find the path to the proc file system mount point */ -static int path_to_procfs (void) +static int path_to_procfs (const char *tail) { struct mntent *mntent; FILE *fp; @@ -1033,6 +1033,7 @@ static int path_to_procfs (void) if (fp == NULL) { /* Default the mount location of /proc */ strlcpy (route_buffer, "/proc", sizeof (route_buffer)); + strlcat (route_buffer, tail, sizeof(route_buffer)); return 1; } @@ -1047,6 +1048,7 @@ static int path_to_procfs (void) return 0; strlcpy(route_buffer, mntent->mnt_dir, sizeof (route_buffer)); + strlcat (route_buffer, tail, sizeof(route_buffer)); return 1; } @@ -1057,11 +1059,10 @@ static int path_to_procfs (void) static char *path_to_route (void) { - if (!path_to_procfs()) { + if (!path_to_procfs("/net/route")) { error("proc file system not mounted"); return 0; } - strlcat (route_buffer, "/net/route", sizeof(route_buffer)); return (route_buffer); } @@ -2396,21 +2397,16 @@ int sys_check_options(void) { #ifdef IPX_CHANGE - struct stat stat_buf; /* * Disable the IPX protocol if the support is not present in the kernel. - * If we disable it then ensure that IP support is enabled. */ - while (ipxcp_protent.enabled_flag) { - if (path_to_procfs()) { - strlcat (route_buffer, "/net/ipx_interface", sizeof(route_buffer)); - if (lstat (route_buffer, &stat_buf) >= 0) - break; + if (ipxcp_protent.enabled_flag) { + struct stat stat_buf; + if (path_to_procfs("/net/ipx_interface") + || lstat (route_buffer, &stat_buf) < 0) { + error("IPX support is not present in the kernel\n"); + ipxcp_protent.enabled_flag = 0; } - error("IPX support is not present in the kernel\n"); - ipxcp_protent.enabled_flag = 0; - ipcp_protent.enabled_flag = 1; - break; } #endif if (demand && driver_is_old) { -- 2.39.2