From 3354610e7db0fa531e68a6e6e61ce86af66e6031 Mon Sep 17 00:00:00 2001 From: brooks Date: Sat, 10 Dec 2005 03:46:14 +0000 Subject: 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 --- sbin/dhclient/dhclient.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sbin') 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); -- cgit v1.1