1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

1324 Commits

Author SHA1 Message Date
david gauchard
9a2ed274f3 polledTimeout: add option to use CPU count instead of millis() (#5870)
* polledTimeout: add option to use CPU count instead of millis()

* use more "using" alias

* more c++/clear code, using typename (thanks @devyte)

* rename class name to include unit, introduce timeMax() and check it with assert()

* remove useless defines

* improve api readability, add micro-second unit

* update example

* mock: emulate getCycleCount, add/fix polledTimeout CI test

* + nano-seconds, assert -> message, comments, host test

* allow 0 for timeout (enables immediate timeout, fix division by 0)

* typo, set member instead of local variable

* unify error message

* slight change on checkExpired() allows "never expired"
also removed printed message, add YieldAndDelay, simplify calculations

* remove traces of debug.h/cpp in this PR

* include missing <limits> header

* back to original expired test, introduce boolean _neverExpires, fix reset(), getTimeout() is invalid

* fix expiredOneShot with _timeout==0 check

* reenable getTimeout()

* expose checkExpired with unit conversion

* fix timing comments, move critical code to iram

* add member ::neverExpires and use it where relevant

* improve clarity

* remove exposed checkExpired(), adapt LEAmDNS with equivalent

* add API ::resetToNeverExpires(), use it in LEAmDNS

* remove offending constness from ::flagged() LEAmDNS (due do API fix in PolledTimeout)

* simplify "Fast" base classes

* minor variable rename

* Fix examples

* compliance with good c++ manners

* minor changes for consistency

* add missing const

* expired() and bool() moved to iram

* constexpr compensation computing

* add/update comments

* move neverExpires and alwaysExpired
2019-04-05 10:50:53 -03:00
david gauchard
f0eb5509a0
use static_assert to check on fw structure changes over updates (fix) (#5946) 2019-04-03 23:17:09 +02:00
david gauchard
ca79f2ce39
use static_assert to check on fw structure changes over updates (#5939) 2019-04-02 00:44:27 +02:00
Evgeny Dontsov
68c0a1cc9e sta_config_equal (#5937)
* sta_config_equal

* sta_config_equal bug update
2019-04-01 15:38:09 -03:00
david gauchard
2e75e88c49
bugfix: restore WiFi::setSleepMode functionality with sdk-2.2.x (#5919) 2019-03-26 14:07:49 +01:00
Zachary Drew
7a2e935f53 Fix OTA in AP mode (#5894)
OTA is broken in AP mode because ESP8266mDNS is checking whether the station is connected before processing. Change the logic to WiFi.isConnected() OR WiFi.softAPgetStationNum()>0 fixes the issue.
2019-03-21 12:05:16 -07:00
Ahmed El Sharnoby
e829221833 Fix ssdp (#5750)
* Update ESP8266SSDP.h

Fix SSDP bug: The response to M-Search Packet with ST field set to UUID should be with the UUID not the Device Type
Integrated 'uuid:' prefix into the char array of the _uuid

* Update ESP8266SSDP.cpp

Fix SSDP bug: The response to M-Search Packet with ST field set to UUID should be with the UUID not the Device Type
Integrated 'uuid:' prefix into the char array of the _uuid

* include 'uuid:' in format String and in flash

* Update ESP8266SSDP.cpp
2019-03-21 18:21:48 +01:00
Max Prokhorov
8961bba94e LEAmDNS: remove implicit debug statements (#5895) 2019-03-21 17:04:12 +01:00
Jiri Bilek
64e30b270b Fix the changed structure of the input file (#5891)
The input file containing certificates has changed.
2019-03-18 15:15:59 -07:00
Earle F. Philhower, III
68bcc41429 Fix SSID reporting for 32-char SSIDs (#5889)
Fixes 5853
2019-03-17 23:06:41 -03:00
david gauchard
a3ea816e65
add optional espressif fw nonos-sdk 2.2.x (19.03.13) (#5873) 2019-03-14 13:35:26 +01:00
david gauchard
e5b4de3633
fix DEBUG macros (#5728)
* fix DEBUG macros

All fmt strings in flash
fix #5658

This also allows to avoid warnings and easy mistakes with (no brace):
    if (something)
        DEBUGV("blah");

* use newlib unaligned-compatible printf for DEBUGV

* remove useless putprintf since ::printf already uses ets_putc
2019-03-14 11:19:21 +01:00
liebman
e46ccae9d5 optionally allow redirects on HTTPClient & OTA updates (#5009)
* optionally allow redirects on http OTA updates

* Refactored HTTPClient::begin(url...) & setURL functions, now only beginInternal parses URL, sets ports
Added HTTPRedirect example.

* fix indentation for style check

* add space after while for style check

* don't use deprecated begin method in redirect example

* moved redirect handling code to HTTPClient.
only GET and HEAD requests are currently handled automatically
Redirects that fail to be automatically handled return the redirect code as before

* added support for POST/303 redirect
added device redirect tests

* add missing getLocation() implementation

* if the new location is only a path then only update the URI
2019-03-13 01:51:17 +01:00
Thomas Friedrichsmeier
071eeb8b67 Allow to disable DHCP gateway offer when set up of AP. (#4421) 2019-03-13 00:28:41 +01:00
Christoph Laimer
aa8d3482d3 const for Ticker::active() (#5850) 2019-03-08 09:35:38 -03:00
david gauchard
2528013c5d
small addons (#5847)
* make (static) ESP8266WebServer::responseCodeToString visible and usable
* esp8266:coreVersionNumeric(): add a define and comment-example to check on its usability
2019-03-07 11:37:38 +01:00
Earle F. Philhower, III
b1da9eda46
SD Filesystem compatible with 8266 File, using latest SdFat (#5525)
* Add a FAT filesystem for SD cards to Arduino FS

Arduino forked a copy of SD lib several years ago, put their own wrapper
around it, and it's been languishing in our ESP8266 libraries ever since
as SD. It doesn't support long file names, has class names which
conflict with the ESP8266 internal names, and hasn't been updated in
ages.

The original author of the SD library has continued work in the
meantime, and produced a very feature rich implementation of SdFat. It
unfortunately also conflicts with the class names we use in ESP8266
Arduino and has a different API than the internal SPIFFS or proposed
LittleFS filesystem objects.

This PR puts a wrapper around the latest and greatest SdFat library,
by forking it and wrapping its classes in a private namespace "sdfat,"
and making as thin a wrapper as possible around it to conform to
the ESP8266 FS, File, and Dir classes.

This PR also removes the Arduino SD.h class library and rewrites it
using the new SDFS filesystem to make everything in the ESP8266
Arduino core compatible with each other.

By doing so it lets us use a single interface for anything needing a
file instead of multiple ones (see SDWebServer and how a different
object is needed vs. one serving from SPIFFS even though the logic is
all the same). Same for BearSSL's CertStores and probably a few others
I've missed, cleaning up our code base significantly.

Like LittleFS, silently create directories when a file is created with
a subdirectory specifier ("/path/to/file.txt") if they do not yet exist.

Adds a blacklist of sketches to skip in the CI process (because SdFat
has many examples which do not build properly on the ESP8266).

Now that LittleFS and SDFS have directory support, the FS needs to be
able to communicate whether a name is one or the other.  Add a simple
bool FS::isDirectory() and bool FS::isFile() method.  SPIFFS doesn't
have directories, so if it's valid it's a file and reported as such.

Add ::mkdir/::rmdir to the FS class to allow users to make and destroy
subdirectories.  SPIFFS directory operations will, of course, fail
and return false.

Emulate a 16MB SD card and allow test runner to exercise it by using
a custom SdFat HOST_MOCK-enabled object.

Throw out the original Arduino SD.h class and rewrite from scratch using
only the ESP8266 native SDFS calls.  This makes "SD" based applications
compatible with normal ESP8266 "File" and "FS" and "SPIFFS" operations.

The only major visible change for users is that long filenames now are
fully supported and work without any code changes.  If there are static
arrays of 11 bytes for old 8.3 names in code, they will need to be
adjusted.

While it is recommended to use the more powerful SDFS class to access SD
cards, this SD.h wrapper allows for use of existing Arduino libraries
which are built to only with with that SD class.

Additional helper functions added to ESP8266 native Filesystem:: classes
to help support this portability.

The rewrite is good enough to run the original SDWebServer and SD
example code without any changes.

* Add a FSConfig and SDFSConfig param to FS.begin()

Allows for configuration values to be passed into a filesystem via the
begin method.  By default, a FS will receive a nullptr and should so
whatever is appropriate.

The base FSConfig class has one parameter, _autoFormat, set by the
default constructor to true.

For SPIFFS, you can now disable auto formatting on mount failure by
passing in a FSConfig(false) object.

For SDFS a SDFSConfig parameter can be passed into config specifying the
chip select and SPI configuration.  If nothing is passed in, the begin
will fail since there are no safe default values here.

* Add FS::setConfig to set FS-specific options

Add a new call, FS::setConfig(const {SDFS,SPIFFS}Config *cfg), which
takes a FS-specific configuration object and copies any special settings
on a per-FS basis.  The call is only valid on unmounted filesystems, and
checks the type of object passed in matches the FS being configured.

Updates the docs and tests to utilize this new configuration method.

* Add ::truncate to File interface

Fixes #3846

* Use polledTimeout for formatting yields, cleanup

Use the new polledTimeout class to ensure a yield every 5ms while
formatting.

Add in default case handling and some debug messages when invalid inputs
specified.

* Make setConfig take const& ref, cleaner code

setConfig now can take a parameter defined directly in the call by using
a const &ref to it, leading to one less line of code to write and
cleaner reading of the code.

Also clean up SDFS implementation pointer definition.
2019-03-06 02:14:44 +00:00
Earle F. Philhower, III
95cf925719
Add OOM check and debug message in CertStore (#5820)
Fixes #5819
2019-02-26 02:46:25 +00:00
david gauchard
7745e99046
Revert to nonos-sdk 2.2.1, new sdk-switching option in IDE menu for generic board only (#5763)
This commit allows switching SDK firmware:

nonos-sdk-pre-v3 shipped with release 2.5.0 has issues:

    * Some boards show erratic behavior (radio connection is quickly lost), with an unknown cause.
      These boards work well with previous nonos-sdk-2.2.1 firmware (#5736)

    * Overall performances seem to have decreased (#5513)

This PR restores sdk2.2.1 (as in core-2.4.2).

SDK-pre-3.0 - which has brought long awaited fixes (WiFi sleep modes) - is still available through a menu option available only with generic board.

BREAKING

    * new define `-DNONOSDK221=1` or `-DNONOSDK3V0=1`

    * for external build systems: new library directory: `tools/sdk/lib/<version>/lib`

    * PIO: variable `PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3` is needed for sdk-pre-v3.


Fix #5736
2019-02-19 13:10:49 +01:00
Clemens Kirchgatterer
e721089e60 Fix hardcoded dependency of ArduinoOTA on mDNS (#5768)
Fixes #4643 

This is especially important when compiling for host mode, because ArduinoOTA is pulled in unconditionally by the Makefile in tests/host. Thus it breaks the build as soon as NO_GLOBAL_INSTANCES or NO_GLOBAL_MDNS is defined.
2019-02-16 10:44:43 -03:00
david gauchard
6c5269a74b
fix UdpContext::(connect,listen) signature by using IPAddress (#5742)
* fix UdpContext::listen signature by using IPAddress
* fix UdpContext::connect signature by using IPAddress
  by courtesy of @AlfredLamoule
2019-02-11 13:46:40 +01:00
david gauchard
1959311180
UdpContext::setMulticastInterface(): fix for IPv6 (#5743)
Per 'udp_set_multicast_netif_addr()' signature and comments in lwIP sources:
An IPv4 address designating a specific interface must be used.
When an IPv6 address is given, the matching IPv4 in the same interface must be selected.

fix e3bc3c226b (r32235572)
2019-02-08 15:23:08 +01:00
dav1901
c08efb52fb Adjust send_P to function the same as send (#5507) 2019-02-07 20:39:20 +00:00
Earle F. Philhower, III
d2a8e8acc2
Add debug messages on BSSL errors (#5723)
Add debugging output when DEBUG_ESP_SSL is defined.
Add dump of actual error when connect fails
2019-02-07 05:18:31 +00:00
Jiří Engelthaler
c218d945a4 CaptivePortalAdvanced: Fix compatibility with Android (#5069)
Android refuses to show page with missing Content-Length header.
Prepare page data to String and send it with server.send
Moved respose strings to PROGMEM
2019-02-05 13:28:37 +01:00
hreintke
82789d201c Functional update, host and service probes (#5653)
* Functional update, host and service probes

* Fix ServiceMonitor.ino warnings

* Adding MDNSServiceQueryCallback functional
ServiceMonitor.ino needs some updates for web page but works on Serial output.

* DynamicServices Functional

* Fix ServiceMonitor to match latest MDNSServiceInfo

* Fix unused variable in LEAdns.h

* mDNS_Clock.ino fix

* example restyle

* Add keyValues and answerInfo

* Waring and formattin fix

* Change     struct MDNSServiceInfo   {  MDNSServiceInfo(MDNSResponder ...
to     struct MDNSServiceInfo { MDNSServiceInfo(MDNSResponder&

* Make AnswerType user friendly

* Update ServiceInfo example

* Code cleanup

* AnswerType update, Astyle update servicemonitor

* Update clock example to webserver

* Second typedef for probe callbacks
Change String -> const char* at multiple locations

* Optimizations

* Update callbacks to void

* esp32 compatibility

* std::map to const char*

* Fix emplace_back call

* Change Dynamic callback to void(...)

* Add WiFi events reset() in close()
2019-02-05 00:40:45 -03:00
Develo
04dc463153
Wire Examples based on AVR ones of the same name (#5713)
* Wire Examples based on AVR ones of the same name

* Overload for begin(), change in callback arg from int to size_t

* Update master_reader.ino

Astyle

* Update master_writer.ino

Astyle

* Update slave_receiver.ino

Remove warning

* Update slave_receiver.ino

Astyle
2019-02-04 14:47:29 -03:00
Earle F. Philhower, III
8c01516f8a Allow unaligned input/output to SPI::transferBytes (#5709)
* Allow unaligned input/output to SPI::transferBytes

Fixes #4967

Support any alignment of input and output pointers and transfer lengths
in SPI::transferBytes.  Use 32-bit transfers and FIFO as much as
possible.

* Refactor misaligned transfer, avoid RMW to FIFO

The SPI FIFO can't properly do RMW (i.e. bytewise updates) because when
you read the FIFO you are actually reading the SPI read data, not what
was written into the write FIFO.

Refactor the transferBytes to take account of this.  For aligned input
and outputs, perform as before (but handle non-x4 sizes properly).  For
misaligned inputs, if it's unidirectional then do bytewise until the
direction data pointer is aligned and then do 32b accesses.  Fod
bidirectional and misaligned inputs, copy the output data to an aligned
buffer, do the transfer, then copy the read back data from temp aligned
buffer to the real input buffer.

* Fix comments, clean condition checks, save stack

Add more comments and adjust naming to be more informative in
transferBytes_ and *aligned_.  Save 64bytes of stack in double
misaligned case.

* Optimize misaligned transfers, reduce code size

On any misaligned input or output, always use a temp buffer.  No need
for special casing and bytewise ::transfer().  This should be faster as
bytewise ::transfer involves a significant number of IO register
accesses and setup.  Thanks to @devyte for the suggestion.
2019-02-03 12:17:06 -03:00
Earle F. Philhower, III
56268b166d
Fix memory related issues w/BearSSL server/client (#5706)
Because the constructors of the BSSL client and server add a reference
count to the stack_thunk, if there is no copy constructor defined then
the stack thunk reference count can get out of sync causing the stack
thunk memory to be freed while still in use.  That could cause random
crashes or hangs.

Add a very basic copy constructor to the WiFiClientSecure and
WiFiServerSecure objects, using the default operator= to duplicate
simple types and shared_ptr classes.

The _cipher_list element (used only w/custom ciphers) could be freed
while still in use if copies of the WiFiClientSecure object were made.

Use a shared_ptr which will only free when the last reference is
deleted.

The axTLS compatibility mode calls allocate and store elements needed
for SSL connections (unlike normal BearSSL calls).  These elements could
be freed mistakenly while still in use if copies of the WiFiClientSecure
were made by the app.

Convert to a separately managed shared_ptr to ensure they live as long
as any referencing objects before deletion.

Same done for the axTLS compatability for WiFiServerSecure.
2019-02-02 18:09:19 +00:00
david gauchard
1cacf92ce1 stop lwIP dhcp client when WiFi goes off. (#5703)
* stop lwIP dhcp client with WiFi goes off.

* stop dhcp-client when really unused
2019-02-01 14:33:26 -03:00
Earle F. Philhower, III
3f8cd46dc2
Fix BearSSL Server WDT (#5702)
Fixes #5701 WDTs and other issues with BearSSL::WiFiServerSecure

The BSSL server was creating the client it returns on a connection in a
way that caused the counter for the stack_thunk to get out of sync and
cause it to be freed improperly by having the destructor be called one
more time than the constructor.  Looks like RVO.

Rewrite the ::available() function in order to avoid this issue with
help from @devyte.
2019-02-01 06:47:42 +00:00
LaborEtArs
3f267bd238 LEAmDNS_Fixes_1_3 (#5689)
* LEAmDNS_Fixes_1_3

* Updated LEAmDNSResponder::begin()
2019-01-29 23:24:59 -03:00
david gauchard
f42bfdfc0d
adaptations for lwIP-v1.4 (#5682)
* adaptations for lwIP-v1.4
* add lwIP-v1.4 in CI
2019-01-28 22:31:59 +01:00
SmartBlug
5e4c2e9750 Add capability to have light static DHCP lease (#5594)
* Add capability to have light static DHCP lease

* added ESP8266WiFi StaticLease sample

* Update StaticLease to IPv4
2019-01-25 02:25:04 +00:00
david gauchard
7c5be91430 dynamic WiFi.hostname("newname") (#5652)
* dynamic WiFi.hostname("newname")

* WiFi.hostname() back to String return type

* no silent hostname fix but proceed with debug message and returning false
2019-01-24 17:13:20 -03:00
Earle F. Philhower, III
bff3a6d963 GDB support w/new toolchain and UART driver (#5559)
* Add full gdb support with uart/Serial integration

* Fix GDB merge errors

* Update to unpatched GDB protocol specification

It appears that Espressif patched the open source xtensa GDB port in
order to build their old GDB executable and their old gdbstub (basically
removing any register in a generic xtensa and only leaving those
present in the chip they synthesized).  Their GDBStub also assumed this
behavior.

Unpatched upstream GNU GDB now expects all the registers in
xtensa-config.c to be sent/read on a 'g' command.  Change the GDB stub
to send "xxxxxxxx"s (legal per the spec) for unimplemented registers.
This makes the 'g' response much longer, but it's results are cached
and in an interactive debugger it isn't noticeable.

* Fix .iram.literal to come before .iram.text for GDB

* Move functions to flash, call using wrappers

All functions which are not interrupt or exception called are now in
flash. A small IRAM wrapper enables flash when processing main GDB ops
by calling Cache_Read_Enable_New() and then jumping to the main flash
code.  This seems to work for catching exceptions, data and code breaks,
and Ctrl-C.

The UART ISR handler and exception handler register-saving bits of
code in ASM are still in IRAM.

GDB IRAM usage is now about 670 bytes.

* Remove LWIP2 builder commit

* Add documentation and gdbstub_init header

Add some simple GDB documentation to the main tree showing a worked
example.

Adds the definition of `void gdbstub_init()` to <GDBStub.h>

* Clean up GDB include and library dir

Replace GDBstub.h with the version in the internal/ directory, and
adjust stub code accordingly.  This way, only one copy of a file called
"GDBstub.h" will exist.

Update the gdbcommands and replace the obsolete ESPRESSIF readme with
@kylefleming's version since we're mainly doing serial, not TCP,
connected debugging.

Bump the library rev. number since this is a pretty big functionality
change.

Minor documentation tweak.

* Undo much of UART refactoring, set fifo IRQ to 16

Remove the refactoring of pin control and other little things not directly
related to GDB processing.  Should greatly reduce the diff size in uart.c.
Should also remove any register value changes (intended or otherwise)
introduced in the original PR from @kylefleming.

Set the FIFO interrupt to 16 chars when in GDB mode, matching the latest
UART configuration for highest speed.

* Add architecture comments, cleanup uart.c code

Comments added to UART.c trying to explain (as best as I understand it)
the changes done to support GDB and how they interact with standard
operation.

Fix the uart_uninit to stop the ISR and then free appropriately.

Fix uart_isr_handle_data (GDB's shim for sending chars to the 8266 app)
to do the exact same thing as the standard UART handler including set
the overflow properly and either discard or overwrite in that case.

Fix serial reception when GDB enabled by enabling the user recv ISR.

Remove commented attributes from gdbstub, leftover from the move to
flash.

General logic cleanup per comments in the PR.

* Also set the UART flags for HW error in GDB

Ensure we also check the UART flags and set the uart status
appropriately when in GDB mode.
2019-01-23 17:51:35 -03:00
LaborEtArs
a89ab24edc LEAmDNS Fixes (#5641)
- Better separation of ESP wifi thread code from user thread code
- Added a flag for 'update()'-less use (disabled by default)
- The too fast updates for service queries are fixed
- Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful)
- The device should stay visible now even after the first TTL timeout
- Improved service querying (queries five times now)
- Fixed TTL (bug introduced with Fixes 1.0)
2019-01-22 12:21:42 +01:00
hreintke
e9a6fd2f82 Update mDNS examples to use HTTP Server instead of TCP Server (#5589) 2019-01-22 10:04:56 +01:00
Mike C
d7094f2269 Release referenced resources in the destructor for ESP8266SSDP (#5607)
* Release referenced resources in destructor

* Release referenced resources in destructor, corrected for IPV6

* Release referenced resources in destructor, per suggested changes
2019-01-22 00:00:19 -03:00
carlsa
cee0796a87 Changed I2C buffer from 32 to 128 bytes to match Espressif's ESP32 Arduino core (#3576) 2019-01-20 01:00:43 -03:00
liebman
049a9eaa5b decorate as override virtual methods in WiFiUDP (#5637)
make WiFiUDP destructor virtual
add empty virtual destructor to Udp
2019-01-20 00:34:21 +01:00
david gauchard
b666435282 WiFiClient::remoteIP: fix nullptr crash (#5634) 2019-01-18 22:08:32 -03:00
LaborEtArs
570b9a6b6a LEAmDNS Fixes 1.1 (#5619)
* Fixes 1.1

- Better separation of ESP wifi thread code from user thread code
- Added a flag for 'update()'-less use (disabled by default)
- The too fast updates for service queries are fixed
- Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful)
- The device should stay visible now even after the first TTL timeout
- Improved service querying (queries five times now)

* Update mDNS_Clock.ino

Removed references to LEATimeFlag.h

* Update mDNS_Clock.ino

Styling
2019-01-18 15:59:26 -03:00
david gauchard
6bd26a3b4a
host emulation: improve udp, persistent spiffs (#5605) 2019-01-15 22:56:54 +01:00
david gauchard
dc03293d82
(re)introduce timeout in HardwareSerial::readBytes(buffer, size) (#5558)
(re)introduce timeout in HardwareSerial::readBytes(buffer, size), add HardwareSerial::read(buffer, size) + visual test
2019-01-08 04:01:21 +01:00
SimonWilkinson
eaac1e8b24 Rework DNSServer to be more robust (#5573)
* DNSServer: Handle examplewww.com correctly

Just replacing 'www.' with the empty string when we assign the
domainname will remove all occurrences of 'www.', not just those
at the start of the string.

Change this to a startsWith check so that only "www." at the
beginning of the string is removed.

* DNSServer: Rework request handling

Rewrite the request handling in the DNSServer code to address the
following issues:

Compatibility with EDNS #1:

   RFC6891 says that
     "Responders that choose not to implement the protocol
      extensions defined in this document MUST respond with a
      return code (RCODE) of FORMERR to messages containing an
      OPT record in the additional section and MUST NOT include an
      OPT record in the response"

   If we have any additional records in the request, then we need
   to return a FORMERR, and not whatever custom error code the user
   may have set.

Compatibility with EDNS #2:

   If we're returning an error, we need to explicitly zero all of
   the record counters. In the existing code, if there is an
   additional record present in the request, we return an ARCOUNT
   of 1 in the response, despite including no additional records
   in the payload.

Don't answer non-A requests

   If we receive an AAAA request (or any other non-A record)
   requests, we shouldn't respond to it with an A record.

Don't answer non-IN requests

   If we receive a request for a non-IN type, don't answer it
   (it's unlikely that we'd see this in the real world)

Don't read off the end of malformed packets

   If a packet claims to have a query, but then doesn't include
   one, or includes a query with malformed labels, don't read off
   the end of the allocated data structure.

* DNSServer: Clarify and tidy writing the answer record

Modify the code used to write the answer record back to the server
so that it is clearer that we are writing network byte order
16-bit quantities, and to clarify what's happening with the pointer
used at the start of the answer.
2019-01-05 12:47:00 -03:00
hreintke
62b8ac6be7 Fix LeamDNS examples (#5563)
* Fix LeamDNS examples

* Fix Style check error

* Another style fix
2018-12-29 00:00:16 -03:00
david gauchard
eb5d636f0d
use newlib api in new mDNS, fix host using mDNS (#5545) 2018-12-27 22:06:10 +01:00
david gauchard
cac22e3576
fix dhcp6 in upstream lwIP (#5560) 2018-12-27 19:29:04 +01:00
david gauchard
e3bc3c226b
Fixes for IPv6, added in CI (#5557) 2018-12-27 16:13:48 +01:00