When setting route, don't print an error if EEXIST is returned by the ioctl().
This 'error' merely means that the installed route already exists.
This commit is contained in:
parent
bec1d30279
commit
8ede75738f
@ -1,5 +1,5 @@
|
||||
/* linux.c - ifchd Linux-specific functions
|
||||
* Time-stamp: <2011-04-30 07:28:08 nk>
|
||||
* Time-stamp: <2011-05-31 11:54:30 njk>
|
||||
*
|
||||
* (C) 2004-2011 Nicholas J. Kain <njkain at gmail dot com>
|
||||
*
|
||||
@ -270,8 +270,11 @@ void perform_router(int idx, char *str)
|
||||
ifnam[idx], strerror(errno));
|
||||
return;
|
||||
}
|
||||
if (ioctl(fd, SIOCADDRT, &rt))
|
||||
log_line("%s: failed to set route: %s\n", ifnam[idx], strerror(errno));
|
||||
if (ioctl(fd, SIOCADDRT, &rt)) {
|
||||
if (errno != EEXIST)
|
||||
log_line("%s: failed to set route: %s\n",
|
||||
ifnam[idx], strerror(errno));
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user