summaryrefslogtreecommitdiff
path: root/usr.sbin/unwindctl
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-11-19 14:49:37 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-11-19 14:49:37 +0000
commit7101d997537414f0b82b5913ef74dee280e208c3 (patch)
tree9550c4e976bd5b2690b1059fe72e49b172b4aa68 /usr.sbin/unwindctl
parentbc08d54d0e93b6ebce7053b173dfcdf106b29d1f (diff)
Print learned forwarders in unwindctl.
Someone please make this pretty. Tested by deraadt as part of a larger diff.
Diffstat (limited to 'usr.sbin/unwindctl')
-rw-r--r--usr.sbin/unwindctl/unwindctl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/unwindctl/unwindctl.c b/usr.sbin/unwindctl/unwindctl.c
index e2c7b7e877f..1371d74d889 100644
--- a/usr.sbin/unwindctl/unwindctl.c
+++ b/usr.sbin/unwindctl/unwindctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unwindctl.c,v 1.11 2019/11/11 05:51:06 florian Exp $ */
+/* $OpenBSD: unwindctl.c,v 1.12 2019/11/19 14:49:36 florian Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -222,8 +222,9 @@ main(int argc, char *argv[])
int
show_status_msg(struct imsg *imsg)
{
- static int header;
+ static int header, autoconf_forwarders;
struct ctl_resolver_info *cri;
+ struct ctl_forwarder_info *cfi;
enum captive_portal_state captive_portal_state;
if (imsg->hdr.type != IMSG_CTL_CAPTIVEPORTAL_INFO && !header++)
@@ -253,6 +254,13 @@ show_status_msg(struct imsg *imsg)
uw_resolver_state_str[cri->state],
cri->oppdot ? " (opportunistic DoT)" : "");
break;
+ case IMSG_CTL_AUTOCONF_RESOLVER_INFO:
+ cfi = imsg->data;
+ if (!autoconf_forwarders++)
+ printf("\nlearned forwarders:\n");
+ printf("[%s] %s\n", cfi->src == RTP_PROPOSAL_DHCLIENT
+ ? " DHCP" : "SLAAC", cfi->name);
+ break;
case IMSG_CTL_RESOLVER_WHY_BOGUS:
/* make sure this is a string */
((char *)imsg->data)[imsg->hdr.len - IMSG_HEADER_SIZE -1] =