summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2018-02-24 06:31:48 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2018-02-24 06:31:48 +0000
commit97ad854d19cd8e4bae1997e2bfd834ec439fa7f2 (patch)
tree6bf6d09520c21935d085fcfc1f37e11195619416 /sbin
parentd8b8e34c0941caadb05671ae0aa2cb5f0276240d (diff)
return early on some unhandled ioctls rather than err().
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/brconfig.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sbin/ifconfig/brconfig.c b/sbin/ifconfig/brconfig.c
index 86d59394569..0ab432b6bed 100644
--- a/sbin/ifconfig/brconfig.c
+++ b/sbin/ifconfig/brconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brconfig.c,v 1.18 2018/02/08 13:15:32 mpi Exp $ */
+/* $OpenBSD: brconfig.c,v 1.19 2018/02/24 06:31:47 dlg Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -276,8 +276,12 @@ bridge_cfg(const char *delim)
u_int16_t bprio;
strlcpy(ifbp.ifbop_name, name, sizeof(ifbp.ifbop_name));
- if (ioctl(s, SIOCBRDGGPARAM, (caddr_t)&ifbp))
- err(1, "%s", name);
+ if (ioctl(s, SIOCBRDGGPARAM, (caddr_t)&ifbp) == -1) {
+ if (errno == ENOTTY)
+ return;
+ err(1, "%s SIOCBRDGGPARAM", name);
+ }
+
printf("%s", delim);
pri = ifbp.ifbop_priority;
ht = ifbp.ifbop_hellotime;
@@ -320,8 +324,11 @@ bridge_list(char *delim)
err(1, "malloc");
bifc.ifbic_buf = inbuf = inb;
strlcpy(bifc.ifbic_name, name, sizeof(bifc.ifbic_name));
- if (ioctl(s, SIOCBRDGIFS, &bifc) < 0)
- err(1, "%s", name);
+ if (ioctl(s, SIOCBRDGIFS, &bifc) < 0) {
+ if (errno == ENOTTY)
+ return;
+ err(1, "%s SIOCBRDGIFS", name);
+ }
if (bifc.ifbic_len + sizeof(*reqp) < len)
break;
len *= 2;