diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2019-11-21 05:01:23 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2019-11-21 05:01:23 +0000 |
commit | 32ca2549d4ac6351adcc382945f69a9b75f7a76e (patch) | |
tree | e98469c59a2e53e05bfae2b7c83afa89a7584ac1 /sbin/unwind | |
parent | f58713916fa2b38d97edfc06723cfff4a6c2cbfa (diff) |
Track on which interface nameservers have been learned.
prodding deraadt@
Diffstat (limited to 'sbin/unwind')
-rw-r--r-- | sbin/unwind/resolver.c | 7 | ||||
-rw-r--r-- | sbin/unwind/resolver.h | 7 | ||||
-rw-r--r-- | sbin/unwind/unwind.h | 3 |
3 files changed, 12 insertions, 5 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index 49bddbc6892..51982b453ee 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.70 2019/11/20 15:50:41 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.71 2019/11/21 05:01:22 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -1575,6 +1575,7 @@ show_status(enum uw_resolver_type type, pid_t pid) best, pid); TAILQ_FOREACH(uw_forwarder, &autoconf_forwarder_list, entry) { memset(&cfi, 0, sizeof(cfi)); + cfi.if_index = uw_forwarder->if_index; cfi.src = uw_forwarder->src; /* no truncation, structs are in sync */ strlcpy(cfi.name, uw_forwarder->name, @@ -1967,6 +1968,8 @@ add_autoconf_forwarders(struct imsg_rdns_proposal *rdns_proposal) sizeof(uw_forwarder->name)) >= sizeof(uw_forwarder->name)) fatalx("strlcpy"); + uw_forwarder->if_index = + rdns_proposal->if_index; uw_forwarder->src = rdns_proposal->src; TAILQ_INSERT_TAIL(&autoconf_forwarder_list, uw_forwarder, entry); @@ -2075,6 +2078,7 @@ replace_dhcp_forwarders(struct imsg_rdns_proposal *rdns_proposal) if (strlcpy(uw_forwarder->name, ns, sizeof(uw_forwarder->name)) >= sizeof(uw_forwarder->name)) fatalx("strlcpy"); + uw_forwarder->if_index = rdns_proposal->if_index; uw_forwarder->src = rdns_proposal->src; TAILQ_INSERT_TAIL(&new_forwarder_list, uw_forwarder, entry); } @@ -2088,6 +2092,7 @@ replace_dhcp_forwarders(struct imsg_rdns_proposal *rdns_proposal) sizeof(uw_forwarder->name)) >= sizeof(uw_forwarder->name)) fatalx("strlcpy"); uw_forwarder->src = tmp->src; + uw_forwarder->if_index = tmp->if_index; TAILQ_INSERT_TAIL(&new_forwarder_list, uw_forwarder, entry); } diff --git a/sbin/unwind/resolver.h b/sbin/unwind/resolver.h index 1ffc053cf0f..0e72a415804 100644 --- a/sbin/unwind/resolver.h +++ b/sbin/unwind/resolver.h @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.h,v 1.8 2019/11/19 14:49:36 florian Exp $ */ +/* $OpenBSD: resolver.h,v 1.9 2019/11/21 05:01:22 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -55,8 +55,9 @@ struct ctl_resolver_info { }; struct ctl_forwarder_info { - char name[1024]; /* XXX, keep in sync with uw_forwarder */ - int src; + char name[1024]; /* XXX, keep in sync with uw_forwarder */ + uint32_t if_index; + int src; }; void resolver(int, int); diff --git a/sbin/unwind/unwind.h b/sbin/unwind/unwind.h index 95085da1345..0d5322595f8 100644 --- a/sbin/unwind/unwind.h +++ b/sbin/unwind/unwind.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unwind.h,v 1.31 2019/11/19 14:49:36 florian Exp $ */ +/* $OpenBSD: unwind.h,v 1.32 2019/11/21 05:01:22 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -126,6 +126,7 @@ enum imsg_type { struct uw_forwarder { TAILQ_ENTRY(uw_forwarder) entry; char name[1024]; /* XXX */ + uint32_t if_index; int src; uint16_t port; }; |