]> granicus.if.org Git - esp-idf/commit
lwip: Enable IPV6_ONLY option for UDP sockets (BSD & netconn)
authorAngus Gratton <angus@espressif.com>
Fri, 7 Jul 2017 11:27:00 +0000 (19:27 +0800)
committerAngus Gratton <gus@projectgus.com>
Sun, 1 Oct 2017 23:50:27 +0000 (10:50 +1100)
commit04a2cefb263678aa42b668ba1fb39c59e9c7296a
tree7101862ed5651b256f7dbf162b7759a0c0d079fe
parent961180617ea7d9676c139cc6f2ce9f788d2bbfbc
lwip: Enable IPV6_ONLY option for UDP sockets (BSD & netconn)

* setsockopt(s, IPV6_ONLY, &one, sizeof(int)) will disable IPV6-only
  mode. Incoming/outgoing IPV4 packets are dropped.

* Otherwise, sockets bound to IPV6_ANY_ADDR can receive unicast packets
  for IPV4 or IPV6.

* sendto() a IPV6-mapped-IPV4 address on a UDP socket works correctly
  (not supported for RAW or TCP sockets.)

* getaddrinfo() option AI_V4MAPPED is implemented.

As well as extending support to TCP & RAW, there is some potential improvement
to dropping incoming packets - the drop happens a bit late in the process and
there is no "ICMP port unreachable" response sent.
components/lwip/api/api_msg.c
components/lwip/api/netdb.c
components/lwip/api/sockets.c
components/lwip/core/udp.c
components/lwip/include/lwip/lwip/ip_addr.h