aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-21 17:34:42 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-21 17:34:42 +0200
commit73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0 (patch)
tree521b38a8a279c402095bbde76072608b5b5d4bed
parentaf55c4e98fd164669bb3d1149fb097c365085353 (diff)
downloadpasst-73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0.tar
passt-73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0.tar.gz
passt-73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0.tar.bz2
passt-73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0.tar.lz
passt-73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0.tar.xz
passt-73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0.tar.zst
passt-73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0.zip
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>
-rw-r--r--ndp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ndp.c b/ndp.c
index 92abbe9..ec6b5ef 100644
--- a/ndp.c
+++ b/ndp.c
@@ -140,10 +140,11 @@ int ndp(struct ctx *c, struct ethhdr *eh, size_t len)
memcpy(p, &c->dns6[i], 16); /* address */
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) {
*p++ = 31; /* DNSSL */
*p++ = (len + 8 - 1) / 8 + 1; /* length */