diff options
Diffstat (limited to 'roms/ipxe/src/net/udp/dns.c')
-rw-r--r-- | roms/ipxe/src/net/udp/dns.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/roms/ipxe/src/net/udp/dns.c b/roms/ipxe/src/net/udp/dns.c index d1435e769..613541f5a 100644 --- a/roms/ipxe/src/net/udp/dns.c +++ b/roms/ipxe/src/net/udp/dns.c @@ -16,7 +16,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. */ FILE_LICENCE ( GPL2_OR_LATER ); @@ -222,18 +223,24 @@ static char * dns_qualify_name ( const char *string ) { * DNS names consist of "<length>element" pairs. */ static char * dns_make_name ( const char *string, char *buf ) { - char *length_byte = buf++; + char *length_byte; char c; - while ( ( c = *(string++) ) ) { - if ( c == '.' ) { - *length_byte = buf - length_byte - 1; - length_byte = buf; + length_byte = buf++; + *length_byte = 0; + do { + c = *(string++); + if ( ( c == '.' ) || ( c == '\0' ) ) { + if ( *length_byte ) { + length_byte = buf++; + *length_byte = 0; + } + } else { + *(buf++) = c; + (*length_byte)++; } - *(buf++) = c; - } - *length_byte = buf - length_byte - 1; - *(buf++) = '\0'; + } while ( c ); + return buf; } @@ -421,7 +428,7 @@ static int dns_xfer_deliver ( struct dns_request *dns, } /* Determine what to do next based on the type of query we - * issued and the reponse we received + * issued and the response we received */ switch ( qtype ) { @@ -594,14 +601,6 @@ struct setting dns_setting __setting ( SETTING_IPv4_EXTRA ) = { .type = &setting_type_ipv4, }; -/** Domain name setting */ -struct setting domain_setting __setting ( SETTING_IPv4_EXTRA ) = { - .name = "domain", - .description = "DNS domain", - .tag = DHCP_DOMAIN_NAME, - .type = &setting_type_string, -}; - /** * Apply DNS settings * |