Allow readconf to read multilink configs with more than 2 channels.

This commit is contained in:
Carsten Paeth 1998-03-20 07:52:13 +00:00
parent bf32cf3bd6
commit 602d2bbdd9
1 changed files with 20 additions and 1 deletions

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.7 1997/10/27 00:05:03 fritz
* Fixed typo.
*
* Revision 1.6 1997/10/26 23:39:37 fritz
* Applied (slightly modified) fix for compiling without triggercps by
* Bernhard Rosenkraenzer <root@BOL-SubNet.ml.org>
@ -281,6 +284,22 @@ static char* write_all_numbers(char *numbers)
/*****************************************************************************/
static char *get_masterinterface(int fd, char *name)
{
isdn_net_ioctl_cfg cfg;
static char mname[sizeof(cfg.master)];
strncpy(cfg.name, name, sizeof(cfg.name));
if (ioctl(fd, IIOCNETGCF, &cfg) < 0)
return name;
if (cfg.master[0] == 0) return name;
return strncpy(mname, cfg.master, sizeof(mname));
}
/*****************************************************************************/
int readconfig(int fd, char *file)
{
section *Section;
@ -497,7 +516,7 @@ int readconfig(int fd, char *file)
if (!strcmp(Entry->name,CONF_ENT_ADDSLAVE))
{
argv[0] = cmds[ADDSLAVE].cmd;
argv[1] = name;
argv[1] = get_masterinterface(fd, name);
argv[2] = Entry->value;
argv[3] = NULL;
exec_args(fd,3,argv);