[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [PATCH] DNS: Allow a DNS look-up with a trailing dot in the
From: |
Craig McQueen |
Subject: |
[lwip-devel] [PATCH] DNS: Allow a DNS look-up with a trailing dot in the name |
Date: |
Wed, 14 Nov 2018 10:26:02 +1100 |
---
src/core/dns.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/core/dns.c b/src/core/dns.c
index 9d2f61ed..fc84229b 100644
--- a/src/core/dns.c
+++ b/src/core/dns.c
@@ -804,6 +804,10 @@ dns_send(u8_t idx)
pbuf_put_at(p, query_idx, n);
pbuf_take_at(p, hostname_part, copy_len, (u16_t)(query_idx + 1));
query_idx = (u16_t)(query_idx + n + 1);
+ if (*hostname == '.' && *(hostname + 1) == 0) {
+ /* skip any trailing dot */
+ hostname++;
+ }
} while (*hostname != 0);
pbuf_put_at(p, query_idx, 0);
query_idx++;
--
2.18.0.windows.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [PATCH] DNS: Allow a DNS look-up with a trailing dot in the name,
Craig McQueen <=