summaryrefslogtreecommitdiff
path: root/sbin/dhcpleased/printconf.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-08-12 12:41:09 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-08-12 12:41:09 +0000
commitfce50578a5072d36352537102e4b9a5a3e7fbeb1 (patch)
tree7825e2a068a60b6e7d43c72048ef184d2faa60ce /sbin/dhcpleased/printconf.c
parenta0ed0d2d3dc26696438e79a604746bb1653d1d5f (diff)
Make it possible to ignore routes or nameservers from a lease as well
as ignoring servers entirely. Tested by bket Parser looks reasonable to benno man page OK jmc
Diffstat (limited to 'sbin/dhcpleased/printconf.c')
-rw-r--r--sbin/dhcpleased/printconf.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sbin/dhcpleased/printconf.c b/sbin/dhcpleased/printconf.c
index 16b33bbfe40..593733f4e12 100644
--- a/sbin/dhcpleased/printconf.c
+++ b/sbin/dhcpleased/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.1 2021/07/26 09:26:36 florian Exp $ */
+/* $OpenBSD: printconf.c,v 1.2 2021/08/12 12:41:08 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -106,11 +106,24 @@ void
print_config(struct dhcpleased_conf *conf)
{
struct iface_conf *iface;
+ int i;
+ char hbuf[INET_ADDRSTRLEN];
SIMPLEQ_FOREACH(iface, &conf->iface_list, entry) {
printf("interface %s {\n", iface->name);
print_dhcp_options("\t", iface->c_id, iface->c_id_len);
print_dhcp_options("\t", iface->vc_id, iface->vc_id_len);
+ if (iface->ignore & IGN_DNS)
+ printf("\tignore dns\n");
+ if (iface->ignore & IGN_ROUTES)
+ printf("\tignore routes\n");
+ for (i = 0; i < iface->ignore_servers_len; i++) {
+ if (inet_ntop(AF_INET, &iface->ignore_servers[i],
+ hbuf, sizeof(hbuf)) == NULL)
+ continue;
+ printf("\tignore %s\n", hbuf);
+
+ }
printf("}\n");
}
}