summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-03-08 13:22:23 +0000
committerache <ache@FreeBSD.org>1996-03-08 13:22:23 +0000
commit53c7b9f85354394ae5d8d9f88d5cffbb319a9e3b (patch)
tree13faf37531eda1356481a2b8bad3cf8a1776d0ae /usr.sbin
parent8d299fcc23c4b89811dcad056e9db5cbaaaa5ed8 (diff)
downloadFreeBSD-src-53c7b9f85354394ae5d8d9f88d5cffbb319a9e3b.zip
FreeBSD-src-53c7b9f85354394ae5d8d9f88d5cffbb319a9e3b.tar.gz
Prevent dial cycling on the last phone from the list, make phone list copy
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/chat.c8
-rw-r--r--usr.sbin/ppp/command.c5
-rw-r--r--usr.sbin/ppp/vars.h4
3 files changed, 11 insertions, 6 deletions
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index ca7a8b1..f31b441 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -18,7 +18,7 @@
* Columbus, OH 43221
* (614)451-1883
*
- * $Id: chat.c,v 1.6 1996/03/08 09:03:03 ache Exp $
+ * $Id: chat.c,v 1.7 1996/03/08 12:34:37 ache Exp $
*
* TODO:
* o Support more UUCP compatible control sequences.
@@ -153,8 +153,10 @@ int sendmode;
result += strlen(VarAuthKey);
break;
case 'T':
- if (VarNextPhone == NULL)
- VarNextPhone = VarPhoneList;
+ if (VarNextPhone == NULL) {
+ strcpy(VarPhoneCopy, VarPhoneList);
+ VarNextPhone = VarPhoneCopy;
+ }
phone = strsep(&VarNextPhone, ":");
bcopy(phone, result, strlen(phone));
result += strlen(phone);
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 361c1f6..8f86dd8 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.14 1996/01/30 20:04:28 phk Exp $
+ * $Id: command.c,v 1.15 1996/03/08 09:03:04 ache Exp $
*
*/
#include <sys/types.h>
@@ -842,7 +842,8 @@ int param;
break;
case VAR_PHONE:
strncpy(VarPhoneList, *argv, sizeof(VarPhoneList)-1);
- VarNextPhone = VarPhoneList;
+ strcpy(VarPhoneCopy, VarPhoneList);
+ VarNextPhone = VarPhoneCopy;
break;
}
}
diff --git a/usr.sbin/ppp/vars.h b/usr.sbin/ppp/vars.h
index d12257bc..cf28a06 100644
--- a/usr.sbin/ppp/vars.h
+++ b/usr.sbin/ppp/vars.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: vars.h,v 1.4 1995/10/08 14:57:32 amurai Exp $
+ * $Id: vars.h,v 1.5 1996/03/08 09:03:09 ache Exp $
*
* TODO:
*/
@@ -73,6 +73,7 @@ struct pppvars {
char auth_key[50]; /* PAP/CHAP key */
char auth_name[50]; /* PAP/CHAP system name */
char phone_numbers[200]; /* Telephone Numbers */
+ char phone_copy[200]; /* copy for strsep() */
char *next_phone; /* Next phone from the list */
char shostname[MAXHOSTNAMELEN];/* Local short Host Name */
};
@@ -92,6 +93,7 @@ struct pppvars {
#define VarAuthKey pppVars.auth_key
#define VarAuthName pppVars.auth_name
#define VarPhoneList pppVars.phone_numbers
+#define VarPhoneCopy pppVars.phone_copy
#define VarNextPhone pppVars.next_phone
#define VarShortHost pppVars.shostname
#define VarRedialTimeout pppVars.redial_timeout
OpenPOWER on IntegriCloud