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:
Nicholas J. Kain 2011-05-31 11:55:26 -04:00
parent bec1d30279
commit 8ede75738f

View File

@ -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);
}