summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifgroup.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2014-02-27 13:08:43 +0000
committerdes <des@FreeBSD.org>2014-02-27 13:08:43 +0000
commit0af7d6ff77481936f625eec37b1a5bc793fae4de (patch)
tree4fd0cd19facd38a13ad04c409e93e732cfa72e59 /sbin/ifconfig/ifgroup.c
parent3c6681dc2c610038f536ad483a501e35a1a7312c (diff)
downloadFreeBSD-src-0af7d6ff77481936f625eec37b1a5bc793fae4de.zip
FreeBSD-src-0af7d6ff77481936f625eec37b1a5bc793fae4de.tar.gz
MFH (r256768): don't report an error for no-op add / remove
Diffstat (limited to 'sbin/ifconfig/ifgroup.c')
-rw-r--r--sbin/ifconfig/ifgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifgroup.c b/sbin/ifconfig/ifgroup.c
index 9eaac3b..f8b18b4 100644
--- a/sbin/ifconfig/ifgroup.c
+++ b/sbin/ifconfig/ifgroup.c
@@ -57,7 +57,7 @@ setifgroup(const char *group_name, int d, int s, const struct afswtch *rafp)
if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
errx(1, "setifgroup: group name too long");
- if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1)
+ if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1 && errno != EEXIST)
err(1," SIOCAIFGROUP");
}
@@ -75,7 +75,7 @@ unsetifgroup(const char *group_name, int d, int s, const struct afswtch *rafp)
if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
errx(1, "unsetifgroup: group name too long");
- if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1)
+ if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1 && errno != ENOENT)
err(1, "SIOCDIFGROUP");
}
OpenPOWER on IntegriCloud