nuttx/net/udp
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
..
Kconfig Make the read ahead buffer unselectable 2020-01-11 08:24:49 -06:00
Make.defs net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_callback.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_close.c net/: Add missing packet filtering checks 2021-04-29 12:47:02 +08:00
udp_conn.c net/udp: fix nxstyle warning 2020-05-15 07:27:01 -06:00
udp_devpoll.c net: fix nxstyle errors 2021-04-02 11:12:25 -05:00
udp_finddev.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_input.c net: fix nxstyle errors 2021-04-02 11:12:25 -05:00
udp_ipselect.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_netpoll.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_notifier.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_recvfrom.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_send.c tools/nxstyle.c: Fix logic error that prevent detecion of '/' and '/=' as operators. net/: Minor updates resulting from testing tools/nxstyle. 2019-03-11 12:48:39 -06:00
udp_sendto_buffered.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
udp_sendto_unbuffered.c Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00
udp_setsockopt.c net/: Add missing packet filtering checks 2021-04-29 12:47:02 +08:00
udp_txdrain.c net: unify socket into file descriptor 2021-03-03 19:01:41 -08:00
udp_wrbuffer_dump.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp_wrbuffer.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
udp.h net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00