udhcpc: make hostname sanitization optional. Closes 3979

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2014-06-16 00:17:00 +02:00
parent 9aa6ffb22b
commit 85090c162b
2 changed files with 15 additions and 0 deletions

View File

@@ -136,6 +136,7 @@ static int mton(uint32_t mask)
return i;
}
#if ENABLE_FEATURE_UDHCPC_SANITIZEOPT
/* Check if a given label represents a valid DNS label
* Return pointer to the first character after the label upon success,
* NULL otherwise.
@@ -192,6 +193,9 @@ static int good_hostname(const char *name)
name++;
}
}
#else
# define good_hostname(name) 1
#endif
/* Create "opt_name=opt_value" string */
static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_optflag *optflag, const char *opt_name)