summaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2020-08-05 06:22:12 +0000
committerkn <kn@cvs.openbsd.org>2020-08-05 06:22:12 +0000
commit326d20f33529c2349cf8eb3055dff364c8511632 (patch)
treed25e1edc4f6873e9999796fd479d2c6990fa3dc2 /sbin/ifconfig
parent24f6d8940f3d40d16a3b3bf12b7e97e9a83cd436 (diff)
Print tpmr(4) members
tpmr is a trivial bridge and has no specific ioctls, so to distinguish it from the rest we must rely on the interface name; assuming that it is tpmr because neither is_bridge() nor is_switch() return success is not possible due to the way ifconfig is designed: it runs all *_status() commands for all interface types. OK dlg
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/brconfig.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sbin/ifconfig/brconfig.c b/sbin/ifconfig/brconfig.c
index 470e36f0571..bcc57964318 100644
--- a/sbin/ifconfig/brconfig.c
+++ b/sbin/ifconfig/brconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brconfig.c,v 1.27 2020/08/05 06:12:43 kn Exp $ */
+/* $OpenBSD: brconfig.c,v 1.28 2020/08/05 06:22:11 kn Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -775,15 +775,28 @@ is_bridge()
return (1);
}
+/* no tpmr(4) specific ioctls, name is enough if ifconfig.c:printif() passed */
+int
+is_tpmr(void)
+{
+ return (strncmp(ifname, "tpmr", sizeof("tpmr") - 1) == 0);
+}
+
void
bridge_status(void)
{
struct ifbrparam bp1, bp2;
- int isswitch = is_switch();
+ int isswitch;
+
+ if (is_tpmr()) {
+ bridge_list("\t");
+ return;
+ }
if (!is_bridge())
return;
+ isswitch = is_switch();
if (isswitch)
switch_cfg("\t");
else