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/physical.c | |
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/physical.c')
-rw-r--r-- | usr.sbin/ppp/physical.c | 12 |
1 files changed, 7 insertions, 5 deletions
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; |