micropython/ports
Angus Gratton a75ca8a1c0 esp32/modsocket: Use all supplied arguments to socket.getaddrinfo().
- Completes a longstanding TODO in the code, to not ignore
  the optional family, type, proto and flags arguments to
  socket.getaddrinfo().

- Note that passing family=socket.AF_INET6 will now cause queries
  to fail (OSError -202). Previously this argument was ignored so
  IPV4 results were returned instead.

- Optional 'type' argument is now always copied into the result. If not
  set, results have type SOCK_STREAM.

- Fixes inconsistency where previously querying mDNS local suffix (.local)
  hostnames returned results with socket type 0 (invalid), but all other
  queries returned results with socket type SOCK_STREAM (regardless of
  'type' argument).

- Optional proto argument is now returned in the result tuple, if supplied.

- Optional flags argument is now passed through to lwIP. lwIP has handling
  for AI_NUMERICHOST, AI_V4MAPPED, AI_PASSIVE (untested, constants for
  these are not currently exposed in the esp32 socket module).

- Also fixes a possible memory leak in an obscure code path
  (lwip_getaddrinfo apparently sometimes returns a result structure with
  address "0.0.0.0" instead of failing, and this structure would have been
  leaked.)

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-01-17 11:00:58 +11:00
..
bare-arm shared/libc/string0: Don't deref args for n==0 case. 2023-11-07 16:01:50 +11:00
cc3200 ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00
embed embed: Fix alloca include for FreeBSD and NetBSD. 2024-01-05 01:03:25 -06:00
esp32 esp32/modsocket: Use all supplied arguments to socket.getaddrinfo(). 2024-01-17 11:00:58 +11:00
esp8266 ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00
mimxrt ports: Move MICROPY_PY_LWIP_ENTER/REENTER/EXIT defns to mphalport.h. 2024-01-05 15:40:06 +11:00
minimal ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00
nrf nrf/modules/os/microbitfs: Sweep the filesystem if any free chunk found. 2024-01-16 11:42:47 +11:00
pic16bit ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00
powerpc ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00
qemu-arm ports: Switch build to use common lib/libm list of source files. 2023-12-08 15:42:41 +11:00
renesas-ra ports: Move MICROPY_PY_LWIP_ENTER/REENTER/EXIT defns to mphalport.h. 2024-01-05 15:40:06 +11:00
rp2 rp2/mpthreadport: Make result of thread.get_ident() a non-zero integer. 2024-01-17 08:02:16 +11:00
samd samd/mcu/samd21: Enable MICROPY_STACK_CHECK on SAMD21. 2024-01-08 23:24:39 +11:00
stm32 stm32/flash: Fix sector and bank calculation for H5 and H7 MCUs. 2024-01-08 12:35:48 +11:00
unix ports: Move MICROPY_INTERNAL_WFE definition to mphalport.h. 2024-01-05 15:49:42 +11:00
webassembly ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00
windows windows/windows_mphal: Fix mp_hal_delay_ms() so it runs events. 2024-01-05 15:56:34 +11:00
zephyr ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00