mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Don't attempt to parse a sequence of hex digits without any colons as IPv6 address.
Another confusion in the heuristic dhcp-option parsing. Sigh.
This commit is contained in:
@@ -1181,7 +1181,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
|
|||||||
{
|
{
|
||||||
/* characterise the value */
|
/* characterise the value */
|
||||||
char c;
|
char c;
|
||||||
int found_dig = 0;
|
int found_dig = 0, found_colon = 0;
|
||||||
is_addr = is_addr6 = is_hex = is_dec = is_string = 1;
|
is_addr = is_addr6 = is_hex = is_dec = is_string = 1;
|
||||||
addrs = digs = 1;
|
addrs = digs = 1;
|
||||||
dots = 0;
|
dots = 0;
|
||||||
@@ -1195,6 +1195,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
|
|||||||
{
|
{
|
||||||
digs++;
|
digs++;
|
||||||
is_dec = is_addr = 0;
|
is_dec = is_addr = 0;
|
||||||
|
found_colon = 1;
|
||||||
}
|
}
|
||||||
else if (c == '/')
|
else if (c == '/')
|
||||||
{
|
{
|
||||||
@@ -1237,6 +1238,9 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
|
|||||||
if (!found_dig)
|
if (!found_dig)
|
||||||
is_dec = is_addr = 0;
|
is_dec = is_addr = 0;
|
||||||
|
|
||||||
|
if (!found_colon)
|
||||||
|
is_addr6 = 0;
|
||||||
|
|
||||||
/* We know that some options take addresses */
|
/* We know that some options take addresses */
|
||||||
if (opt_len & OT_ADDR_LIST)
|
if (opt_len & OT_ADDR_LIST)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user