7332d2decf
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. |
||
---|---|---|
.. | ||
arp | ||
bluetooth | ||
can | ||
devif | ||
icmp | ||
icmpv6 | ||
ieee802154 | ||
igmp | ||
inet | ||
ipforward | ||
local | ||
mld | ||
neighbor | ||
netdev | ||
netlink | ||
pkt | ||
procfs | ||
route | ||
rpmsg | ||
sixlowpan | ||
socket | ||
tcp | ||
udp | ||
usrsock | ||
utils | ||
Kconfig | ||
Makefile | ||
net_initialize.c | ||
README.txt |
README ====== Directory Structure =================== nuttx/ | `- net/ | +- arp - Address resolution protocol (IPv4) +- bluetooth - PF_BLUETOOTH socket interface +- devif - Stack/device interface layer +- icmp - Internet Control Message Protocol (IPv4) +- icmpv6 - Internet Control Message Protocol (IPv6) +- ieee802154 - PF_IEEE802154 socket interface +- inet - PF_INET/PF_INET6 socket interface +- ipforward - IP forwarding logic +- local - Unix domain (local) sockets +- mld - Multicast Listener Discovery (MLD) +- neighbor - Neighbor Discovery Protocol (IPv6) +- netdev - Socket network device interface +- netlink - Netlink IPC socket interface +- pkt - "Raw" packet socket support +- sixlowpan - 6LoWPAN implementation +- socket - BSD socket interface +- route - Routing table support +- tcp - Transmission Control Protocol +- udp - User Datagram Protocol +- usrsock - User socket API for user-space networking stack `- utils - Miscellaneous utility functions +-------------------------------------------------------------------++------------------------+ | Application layer || usrsock daemon | +-------------------------------------------------------------------++------------------------+ +-------------------------------------------------------------------++----------------+ +-----+ | Socket layer (socket/) || /dev/usrsock | | | +-------------------------------------------------------------------++----------------+ | | +------------++--------------------------------------------------++-------------------+ | | | Network || Protocol stacks (arp, ipv6, icmp, pkt, tcp, udp) || usrsock/ | | | | Device |+--------------------------------------------------++-------------------+ | | | Interface |+------------------------------------++---------------------------------+ | | | (netdev/) || Network Device Interface (devif/) || Utilities | | | +------------++------------------------------------++---------------------------------+ | | +----------------------------------------------------------------+ | | | Network Device Drivers | | HAL | +----------------------------------------------------------------+ +-----+ +----------------------------------------------------------------+ +--------------------------+ | Networking Hardware | | Hardware TCP/IP Stack | +----------------------------------------------------------------+ +--------------------------+