diff options
author | brooks <brooks@FreeBSD.org> | 2005-07-28 00:24:39 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-07-28 00:24:39 +0000 |
commit | 80e3e886b551fbb0044ab641b38e546960395f05 (patch) | |
tree | 4a13905d79b62872369486a499d384da0ffa2adf /sbin/dhclient | |
parent | 66b1e1d508a71cb42c06fd39daf8fbd941b07860 (diff) | |
download | FreeBSD-src-80e3e886b551fbb0044ab641b38e546960395f05.zip FreeBSD-src-80e3e886b551fbb0044ab641b38e546960395f05.tar.gz |
Don't reject packets with server names containing characters that are
not allowed in domain names. RFC 2132 does not list valid or invalid
characters and the ISC client accepts anything here.
Reported by: ps
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 6007f32..9f2b269 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -987,7 +987,12 @@ packet_to_lease(struct packet *packet) lease->address.len = sizeof(packet->raw->yiaddr); memcpy(lease->address.iabuf, &packet->raw->yiaddr, lease->address.len); - /* If the server name was filled out, copy it. */ + /* If the server name was filled out, copy it. + Do not attempt to validate the server name as a host name. + RFC 2131 merely states that sname is NUL-terminated (which do + do not assume) and that it is the server's host name. Since + the ISC client and server allow arbitrary characters, we do + as well. */ if ((!packet->options[DHO_DHCP_OPTION_OVERLOAD].len || !(packet->options[DHO_DHCP_OPTION_OVERLOAD].data[0] & 2)) && packet->raw->sname[0]) { @@ -999,12 +1004,6 @@ packet_to_lease(struct packet *packet) } memcpy(lease->server_name, packet->raw->sname, DHCP_SNAME_LEN); lease->server_name[DHCP_SNAME_LEN]='\0'; - if (!res_hnok(lease->server_name) ) { - warning("Bogus server name %s", lease->server_name ); - free_client_lease(lease); - return (NULL); - } - } /* Ditto for the filename. */ |