diff options
author | 2009-11-05 20:30:55 +0000 | |
---|---|---|
committer | 2009-11-05 20:30:55 +0000 | |
commit | 34b295de8ff9136e7c406bee53fd4a05eef094d1 (patch) | |
tree | ecc6702d9fed871e7b39c278f65b13466605222b | |
parent | Add a new PCIOCGETROMLEN ioctl, to give users of PCIOGETROM a chance to (diff) | |
download | wireguard-openbsd-34b295de8ff9136e7c406bee53fd4a05eef094d1.tar.xz wireguard-openbsd-34b295de8ff9136e7c406bee53fd4a05eef094d1.zip |
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.c | 4 |
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); |