diff --git a/usr.sbin/ppp/defs.h b/usr.sbin/ppp/defs.h index 4b9163ad1633..56ddd8936486 100644 --- a/usr.sbin/ppp/defs.h +++ b/usr.sbin/ppp/defs.h @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: defs.h,v 1.42 1999/04/27 00:23:54 brian Exp $ + * $Id: defs.h,v 1.43 1999/05/08 11:06:28 brian Exp $ * * TODO: */ @@ -43,8 +43,9 @@ #define RECONNECT_TIMEOUT 3 /* Default timer for carrier loss */ #define DIAL_TIMEOUT 30 /* Default and Max random time to redial */ #define DIAL_NEXT_TIMEOUT 3 /* Default Hold time to next number redial */ -#define SCRIPT_LEN 512 /* Size of login scripts */ -#define LINE_LEN SCRIPT_LEN /* Size of login scripts */ +#define SCRIPT_LEN 512 /* Size of login/dial/hangup scripts */ +#define LINE_LEN SCRIPT_LEN /* Size of lines */ +#define DEVICE_LEN SCRIPT_LEN /* Size of individual devices */ #define AUTHLEN 100 /* Size of authname/authkey */ #define CHAPDIGESTLEN 100 /* Maximum chap digest */ #define CHAPCHALLENGELEN 48 /* Maximum chap challenge */ diff --git a/usr.sbin/ppp/exec.c b/usr.sbin/ppp/exec.c index 4f6bcc7b5531..93f7fe0bcd17 100644 --- a/usr.sbin/ppp/exec.c +++ b/usr.sbin/ppp/exec.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exec.c,v 1.2 1999/05/12 09:48:49 brian Exp $ + * $Id: exec.c,v 1.3 1999/05/24 16:39:10 brian Exp $ */ #include @@ -151,6 +151,7 @@ exec_Create(struct physical *p) dup2(fids[1], STDOUT_FILENO); dup2(fids[1], STDERR_FILENO); + log_Printf(LogDEBUG, "Exec'ing ``%s''\n", p->name.base); argc = MakeArgs(p->name.base, argv, VECSIZE(argv)); command_Expand(argv, argc, (char const *const *)argv, p->dl->bundle, 0); diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index dc4b4a5497cc..088b2ea43c4f 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: physical.c,v 1.13 1999/05/18 01:37:46 brian Exp $ + * $Id: physical.c,v 1.14 1999/05/24 16:39:12 brian Exp $ * */ @@ -529,11 +529,11 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov, p->type = PHYS_DIRECT; p->dl = dl; len = strlen(_PATH_DEV); - p->name.base = strncmp(p->name.full, _PATH_DEV, len) ? - p->name.full : p->name.full + len; p->out = NULL; p->connect_count = 1; + physical_SetDevice(p, p->name.full); + p->link.lcp.fsm.bundle = dl->bundle; p->link.lcp.fsm.link = &p->link; memset(&p->link.lcp.fsm.FsmTimer, '\0', sizeof p->link.lcp.fsm.FsmTimer); @@ -804,8 +804,10 @@ physical_SetDevice(struct physical *p, const char *name) { int len = strlen(_PATH_DEV); - strncpy(p->name.full, name, sizeof p->name.full - 1); - p->name.full[sizeof p->name.full - 1] = '\0'; + if (name != p->name.full) { + strncpy(p->name.full, name, sizeof p->name.full - 1); + p->name.full[sizeof p->name.full - 1] = '\0'; + } p->name.base = *p->name.full == '!' ? p->name.full + 1 : strncmp(p->name.full, _PATH_DEV, len) ? p->name.full : p->name.full + len; diff --git a/usr.sbin/ppp/physical.h b/usr.sbin/ppp/physical.h index 59f0dcc0fe46..1f3941249072 100644 --- a/usr.sbin/ppp/physical.h +++ b/usr.sbin/ppp/physical.h @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: physical.h,v 1.10 1999/05/12 09:48:58 brian Exp $ + * $Id: physical.h,v 1.11 1999/05/24 16:39:14 brian Exp $ * */ @@ -66,7 +66,7 @@ struct physical { } input; struct { - char full[40]; /* Our current device name */ + char full[DEVICE_LEN]; /* Our current device name */ char *base; } name;