summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2009-11-05 20:30:56 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2009-11-05 20:30:56 +0000
commitc649240f9d10d50e67c6aeed38b727cc1604b555 (patch)
tree69ab7237e294c0dcd6349f448b4a24356db2bd0b
parent4053e3a000003ae604e38a47f7812d6207b95c85 (diff)
adding an interface if it already is added should be successful, not give a
bogus and misleading error, this permits re-running bridgename.if(5) files etc without confusion prodded/found by deraadt@ ok deraadt@ phessler@ henning@ stsp@
-rw-r--r--sbin/brconfig/brconfig.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/brconfig/brconfig.c b/sbin/brconfig/brconfig.c
index 573a1a40ffb..064e6a1d2f5 100644
--- a/sbin/brconfig/brconfig.c
+++ b/sbin/brconfig/brconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brconfig.c,v 1.42 2007/01/01 20:11:17 jmc Exp $ */
+/* $OpenBSD: brconfig.c,v 1.43 2009/11/05 20:30:55 todd Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -848,6 +848,8 @@ bridge_add(int s, char *brdg, char *ifn)
strlcpy(req.ifbr_name, brdg, sizeof(req.ifbr_name));
strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname));
if (ioctl(s, SIOCBRDGADD, &req) < 0) {
+ if (errno == EEXIST)
+ return (0);
warn("%s: %s", brdg, ifn);
if (errno == EPERM)
return (EX_NOPERM);