udhcpc: dns labels can actually start with a number
authorArthur Gautier <baloo@gandi.net>
Tue, 28 Jul 2015 05:35:00 +0000 (05:35 +0000)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 30 Jul 2015 01:03:58 +0000 (03:03 +0200)
While RFC1035 recommends a label not to start with a number, there is
actually no such limitation in dns. One may buy a domain name like
0x1.net and use it.

This commit remove this check and allow a user to use such domains.

Signed-off-by: Arthur Gautier <baloo@gandi.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/udhcp/dhcpc.c

index 9d3d1a31caf95647d06fd15215df8b5f45d8e029..811a1a1eebe527102e02ace0ec2617b5fcee91e6 100644 (file)
@@ -156,10 +156,6 @@ static const char *valid_domain_label(const char *label)
        for (;;) {
                ch = *label;
                if ((ch|0x20) < 'a' || (ch|0x20) > 'z') {
-                       if (pos == 0) {
-                               /* label must begin with letter */
-                               return NULL;
-                       }
                        if (ch < '0' || ch > '9') {
                                if (ch == '\0' || ch == '.')
                                        return label;