ndp: Don't send a DNS search list if we don't have a list of DNS servers
This is not explicitly forbidden, but it confuses the ISC's DHCP client, and doesn't make sense anyway. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
af55c4e98f
commit
73a4a6b7cd
1 changed files with 3 additions and 2 deletions
5
ndp.c
5
ndp.c
|
@ -140,10 +140,11 @@ int ndp(struct ctx *c, struct ethhdr *eh, size_t len)
|
||||||
memcpy(p, &c->dns6[i], 16); /* address */
|
memcpy(p, &c->dns6[i], 16); /* address */
|
||||||
p += 16;
|
p += 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (n = 0; *c->dns_search[n].n; n++)
|
||||||
|
dns_s_len += strlen(c->dns_search[n].n) + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (n = 0; *c->dns_search[n].n; n++)
|
|
||||||
dns_s_len += strlen(c->dns_search[n].n) + 2;
|
|
||||||
if (dns_s_len) {
|
if (dns_s_len) {
|
||||||
*p++ = 31; /* DNSSL */
|
*p++ = 31; /* DNSSL */
|
||||||
*p++ = (len + 8 - 1) / 8 + 1; /* length */
|
*p++ = (len + 8 - 1) / 8 + 1; /* length */
|
||||||
|
|
Loading…
Reference in a new issue