diff options
author | brian <brian@FreeBSD.org> | 1999-06-01 19:08:59 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-06-01 19:08:59 +0000 |
commit | 25a14e6be5af8cb85e20ece06d1f1a51ca0f8633 (patch) | |
tree | dc1cb9952f54d949b98c6e8f205903ac14ba8bbd /usr.sbin/ppp | |
parent | 562681fec0867c961d9c9aaf1465f0a2c8038829 (diff) | |
download | FreeBSD-src-25a14e6be5af8cb85e20ece06d1f1a51ca0f8633.zip FreeBSD-src-25a14e6be5af8cb85e20ece06d1f1a51ca0f8633.tar.gz |
Increase the length of an individual device name to LINE_LEN.
Adjust the base physical device name correctly after a link
transfer (allowing correct multilink callbacks).
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/defs.h | 7 | ||||
-rw-r--r-- | usr.sbin/ppp/exec.c | 3 | ||||
-rw-r--r-- | usr.sbin/ppp/physical.c | 12 | ||||
-rw-r--r-- | usr.sbin/ppp/physical.h | 4 |
4 files changed, 15 insertions, 11 deletions
diff --git a/usr.sbin/ppp/defs.h b/usr.sbin/ppp/defs.h index 4b9163a..56ddd89 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 4f6bcc7b..93f7fe0 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 <sys/param.h> @@ -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 dc4b4a5..088b2ea 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 59f0dcc..1f39412 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; |