incubator-nuttx/net/devif
Gregory Nutt 7332d2decf net/: Add missing packet filtering checks
NuttX provides the UDP_BINDTODEVICE socket option.  This is a UDP protocol-specific implementation of the semi-standard Linux SO_BINDTODEVICE socket option:  "SO_BINDTODEVICE forces packets on the socket to only egress the bound interface, regardless of what the IP routing table would normally choose. Similarly only packets which ingress the bound interface will be received on the socket, packets from other interfaces will not be delivered to the socket." https://codingrelic.geekhold.com/2009/10/code-snippet-sobindtodevice.html

If CONFIG_NET_UDP_BINDTODEVICE is selected and a UDP socket is bound to the device, then unrecognized packets UDP packets must not be dropped, but must be forwarded along to the bound socket unconditionally.

It the typical case, this should have no impact.  It does effect the applications that use DHCP and do select the UDP_BINDTODEVICE socket option.

This PR replace existing improper logic in the code and also the improper attempts to fix problems from PR #3601 and PR #3598.  Those changes are improper because they expose DHCP appliction dependencies in the OS, breaking modularity and independence of the OS and application.

Tested with stm32f4discovery:netnsh with CONFIG_NET_UDP_BINDTODEVICE.  A proper DHCP test setup is needed, however.
2021-04-29 12:47:02 +08:00
..
Make.defs makefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
devif.h tcp: Remove incomplete support for TCP reassembly 2020-12-09 07:25:26 -08:00
devif_callback.c net/devif/devif_callback.c: remove harmful debug check 2020-10-26 14:19:01 -03:00
devif_cansend.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
devif_forward.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
devif_initialize.c tcp: Remove incomplete support for TCP reassembly 2020-12-09 07:25:26 -08:00
devif_iobsend.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
devif_loopback.c Change all files come from Xiaomi/Pinecone to Apache License 2.0 2020-08-22 17:37:21 -06:00
devif_pktsend.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
devif_poll.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
devif_send.c
ipv4_input.c net/: Add missing packet filtering checks 2021-04-29 12:47:02 +08:00
ipv6_input.c net/: Add missing packet filtering checks 2021-04-29 12:47:02 +08:00