Make it possible to substitute INTERFACE when executing commands.
This commit is contained in:
parent
77bf994fe8
commit
017a5a7f59
@ -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));
|
||||
}
|
||||
|
@ -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++ ) {
|
||||
|
Loading…
Reference in New Issue
Block a user