A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
Diff: udp/dns/dnsquery.c
- Revision:
- 193:47a953ab571b
- Parent:
- 187:122fc1996c86
--- a/udp/dns/dnsquery.c Fri Jan 22 13:24:08 2021 +0000 +++ b/udp/dns/dnsquery.c Sun Jan 24 15:09:55 2021 +0000 @@ -15,6 +15,9 @@ #include "dnshdr.h" #include "dnsname.h" #include "dnslabel.h" +#include "ar6.h" +#include "ndp.h" +#include "mac.h" bool DnsQueryTrace = false; @@ -159,6 +162,13 @@ if (_RecordType == DNS_RECORD_NONE) return DO_NOTHING; if (_DnsProtocol == DNS_PROTOCOL_NONE) return DO_NOTHING; + + //For IPv6 UDNS check if have the MAC for the DNS server and, if not, request it and stop + if (_IpProtocol == ETH_IPV6 && _DnsProtocol == DNS_PROTOCOL_UDNS) + { + if (!Ar6CheckHaveMacAndFetchIfNot(NdpDnsServer)) return DO_NOTHING; + } + NetTraceHostCheckIp6(DnsQueryIp6); if (DnsQueryTrace || NetTraceHostGetMatched()) logQuery();