Make it possible to substitute INTERFACE when executing commands.

This commit is contained in:
Poul-Henning Kamp 1997-02-22 09:12:36 +00:00
parent 77bf994fe8
commit 017a5a7f59
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,8 @@ extern void TtyOldMode(), TtyCommandMode();
extern struct pppvars pppVars;
extern struct cmdtab const SetCommands[];
extern char *IfDevName;
struct in_addr ifnetmask;
static int ShowCommand(), TerminalCommand(), QuitCommand();
@ -214,6 +216,9 @@ char **argv;
if (strcmp(argv[i], "HISADDR") == 0) {
argv[i] = strdup(inet_ntoa(IpcpInfo.his_ipaddr));
}
if (strcmp(argv[i], "INTERFACE") == 0) {
argv[i] = strdup(IfDevName);
}
if (strcmp(argv[i], "MYADDR") == 0) {
argv[i] = strdup(inet_ntoa(IpcpInfo.want_ipaddr));
}

View File

@ -272,7 +272,7 @@ int *ptun;
{
int s;
char ifname[IFNAMSIZ];
char devname[14]; /* sufficient room for "/dev/tun65535" */
static char devname[14]; /* sufficient room for "/dev/tun65535" */
unsigned unit, enoentcount=0;
for( unit=0; unit <= MAX_TUN ; unit++ ) {