- Fix a bug which prevented dnssl[0-9] and rdnss[0-9] parameters from

working.

- Fix a pointer calculation for padding when multiple dnssl[0-9]
  parameters are specified [*].

Reported by:	http://bugs.dragonflybsd.org/issues/2847 [*]
This commit is contained in:
hrs 2015-10-22 09:55:40 +00:00
parent 1025a58857
commit 15487e4934

View File

@ -808,7 +808,7 @@ getconfig(struct ifinfo *ifi)
makeentry(entbuf, sizeof(entbuf), i, "rdnss"); makeentry(entbuf, sizeof(entbuf), i, "rdnss");
addr = (char *)agetstr(entbuf, &bp); addr = (char *)agetstr(entbuf, &bp);
if (addr == NULL) if (addr == NULL)
break; continue;
ELM_MALLOC(rdn, exit(1)); ELM_MALLOC(rdn, exit(1));
TAILQ_INIT(&rdn->rd_list); TAILQ_INIT(&rdn->rd_list);
@ -859,7 +859,7 @@ getconfig(struct ifinfo *ifi)
makeentry(entbuf, sizeof(entbuf), i, "dnssl"); makeentry(entbuf, sizeof(entbuf), i, "dnssl");
addr = (char *)agetstr(entbuf, &bp); addr = (char *)agetstr(entbuf, &bp);
if (addr == NULL) if (addr == NULL)
break; continue;
ELM_MALLOC(dns, exit(1)); ELM_MALLOC(dns, exit(1));
@ -1528,6 +1528,7 @@ make_packet(struct rainfo *rai)
/* Padding to next 8 octets boundary */ /* Padding to next 8 octets boundary */
len = buf - (char *)ndopt_dnssl; len = buf - (char *)ndopt_dnssl;
len += (len % 8) ? 8 - len % 8 : 0; len += (len % 8) ? 8 - len % 8 : 0;
buf = (char *)ndopt_dnssl + len;
/* Length field must be in 8 octets */ /* Length field must be in 8 octets */
ndopt_dnssl->nd_opt_dnssl_len = len / 8; ndopt_dnssl->nd_opt_dnssl_len = len / 8;