networking: allow dot at the end of the domain name in dhcp response
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 11 Feb 2016 16:44:44 +0000 (17:44 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 11 Feb 2016 16:44:44 +0000 (17:44 +0100)
Patch based on Balaji Punnuru <balaji.punnuru@gmail.com> work.

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

index 915f659357100bcd322e23fc1cf6dadf51e4214d..48097bc2431b7850f374966580ab5d151bd40b52 100644 (file)
@@ -201,6 +201,8 @@ static int good_hostname(const char *name)
                        //Do we want this?
                        //return ((name - start) < 1025); /* NS_MAXDNAME */
                name++;
+               if (*name == '\0')
+                       return 1; // We allow trailing dot too
        }
 }
 #else