set_ip_bytes() does a 16-byte memcpy from the input buffer to
the local nsapi_addr_t despite the address version.
If the address version is ipv4, the input buffer may only be
4-byte in size. This causes a out-of-bound access on the input buffer.
Signed-off-by: Tony Wu <tonywu@realtek.com>
nsapi_error_t - enum of errors or 0 for NSAPI_ERROR_OK
nsapi_size_t - unsigned size of data that could be sent
nsapi_size_or_error_t - either a non-negative size or negative error
Replace Comodo and OpenDNS IPv4 servers with Google and DNS.WATCH IPv6
servers, so IPv6-only devices (eg 6LoWPAN) have a default.
3 IPv4 resolvers should be plenty - existing code doesn't remember which
one last worked, so if early list entries were unreachable performance
would be consistently bad anyway. Replacing two entries avoids
increasing image size and RAM consumption.
On an IPv6-only or IPv4-only system, the sendto() for the wrong type of
address should fail immediately - change loop to move on to the next
server for any sendto() error.
- cc.h@57,1: "BYTE_ORDER" redefined
- lwip_inet_chksum.c@560,44: passing argument 1 of 'thumb2_checksum'
discards 'const' qualifier from pointer target type
- lwip_pbuf.c@1172,9: variable 'err' set but not used
- SocketAddress.cpp@293,1: control reaches end of non-void function
Takes advantage of the get_ip_address function to predict the IP
address version wanted by the underlying interface. The should avoid
the need for most IPv6 interfaces to overload gethostbyname.
suggested by @kjbracey-arm
Returning a wifi access point without information regarding the
security type is only valid if the security type is unknown (from
the perspective of the network-socket API). For clarity in situations
in which scan may return an unsupported, but known security type,
type name has been changed to NSAPI_SECURITY_UNKNOWN.