summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-12-10 03:46:14 +0000
committerbrooks <brooks@FreeBSD.org>2005-12-10 03:46:14 +0000
commit3354610e7db0fa531e68a6e6e61ce86af66e6031 (patch)
tree5c60003961e7de1ea0732caac36df18610d68d83
parent6bb2e70696f56a5e6d3fb400a66a71bf6419644b (diff)
downloadFreeBSD-src-3354610e7db0fa531e68a6e6e61ce86af66e6031.zip
FreeBSD-src-3354610e7db0fa531e68a6e6e61ce86af66e6031.tar.gz
When we get a bogus hostname in an option, drop the option rather than
refusing the lease. This allow obtaining leases on misadministered networks that use host names with underscores in them. MFC After: 3 days
-rw-r--r--sbin/dhclient/dhclient.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 36a6478..2c722fe 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -2252,6 +2252,8 @@ check_option(struct client_lease *l, int option)
if (!res_hnok(sbuf)) {
warning("Bogus Host Name option %d: %s (%s)", option,
sbuf, opbuf);
+ l->options[option].len = 0;
+ free(l->options[option].data);
return (0);
}
return (1);
@@ -2260,7 +2262,8 @@ check_option(struct client_lease *l, int option)
if (!check_search(sbuf)) {
warning("Bogus domain search list %d: %s (%s)",
option, sbuf, opbuf);
- return (0);
+ l->options[option].len = 0;
+ free(l->options[option].data);
}
}
return (1);
OpenPOWER on IntegriCloud