summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2019-04-02 07:46:03 +0000
committerflorian <florian@openbsd.org>2019-04-02 07:46:03 +0000
commite9937e58f5a7688c5fc75492b3eeb3c07c9fbf91 (patch)
treee7135461f941129dbebc34d57e5f56c323f865d5
parentIntroduce array of resolvers in preparation of custom ordering (diff)
downloadwireguard-openbsd-e9937e58f5a7688c5fc75492b3eeb3c07c9fbf91.tar.xz
wireguard-openbsd-e9937e58f5a7688c5fc75492b3eeb3c07c9fbf91.zip
Collapse case statements to a common fall through and use the passed
in type to identify the resolver now that they can be addressed by index.
-rw-r--r--sbin/unwind/resolver.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c
index aa86d79405c..53960336a73 100644
--- a/sbin/unwind/resolver.c
+++ b/sbin/unwind/resolver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolver.c,v 1.33 2019/04/02 07:45:11 florian Exp $ */
+/* $OpenBSD: resolver.c,v 1.34 2019/04/02 07:46:03 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -1300,25 +1300,12 @@ show_status(enum uw_resolver_type type, pid_t pid)
resolvers[STATIC_DOT_FORWARDER] == best, pid);
break;
case RECURSOR:
- send_resolver_info(resolvers[RECURSOR], resolvers[RECURSOR] ==
- best, pid);
- send_detailed_resolver_info(resolvers[RECURSOR], pid);
- break;
case FORWARDER:
- send_resolver_info(resolvers[FORWARDER], resolvers[FORWARDER]
- == best, pid);
- send_detailed_resolver_info(resolvers[FORWARDER], pid);
- break;
case STATIC_FORWARDER:
- send_resolver_info(resolvers[STATIC_FORWARDER],
- resolvers[STATIC_FORWARDER] == best, pid);
- send_detailed_resolver_info(resolvers[STATIC_FORWARDER], pid);
- break;
case STATIC_DOT_FORWARDER:
- send_resolver_info(resolvers[STATIC_DOT_FORWARDER],
- resolvers[STATIC_DOT_FORWARDER] == best, pid);
- send_detailed_resolver_info(resolvers[STATIC_DOT_FORWARDER],
+ send_resolver_info(resolvers[type], resolvers[type] == best,
pid);
+ send_detailed_resolver_info(resolvers[type], pid);
break;
default:
fatalx("unknown resolver type %d", type);