Commit 3e8ed78b authored by Simon Kelley's avatar Simon Kelley

Fix option parsing for --dhcp-host.

parent 48493329
...@@ -40,6 +40,10 @@ version 2.67 ...@@ -40,6 +40,10 @@ version 2.67
Generalise --interface-name to cope with IPv6 addresses Generalise --interface-name to cope with IPv6 addresses
and multiple addresses per interface per address family. and multiple addresses per interface per address family.
Fix option parsing for --dhcp-host, which was generating a
spurious error when all seven possible items were
included. Thanks to Zhiqiang Wang for the bug report.
version 2.66 version 2.66
Add the ability to act as an authoritative DNS Add the ability to act as an authoritative DNS
......
...@@ -2510,7 +2510,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma ...@@ -2510,7 +2510,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
case 'G': /* --dhcp-host */ case 'G': /* --dhcp-host */
{ {
int j, k = 0; int j, k = 0;
char *a[6] = { NULL, NULL, NULL, NULL, NULL, NULL }; char *a[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
struct dhcp_config *new; struct dhcp_config *new;
struct in_addr in; struct in_addr in;
...@@ -2522,7 +2522,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma ...@@ -2522,7 +2522,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
new->netid = NULL; new->netid = NULL;
if ((a[0] = arg)) if ((a[0] = arg))
for (k = 1; k < 6; k++) for (k = 1; k < 7; k++)
if (!(a[k] = split(a[k-1]))) if (!(a[k] = split(a[k-1])))
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment