6c4bd5c5ef
* net/netdev/netdev_ioctl.c: (netdev_ifr_ioctl): The ioctl SIOCSIFHWADDR sets the hardware address (e.g., Ethernet MAC, etc.) of a network interface. Radio devices may have different lengths of hardware addresses, such as NET_6LOWPAN_EADDRSIZE (8), NET_6LOWPAN_SADDRSIZE (2), or RADIO_MAX_ADDRLEN (8). Also, Kconfig CONFIG_PKTRADIO_ADDRLEN allows the user to set any arbitrary size. Note that while the sister ioctl SIOCGIFHWADDR "get hardware address" copies `dev->d_mac.radio.nv_addrlen` bytes, SIOCSIFHWADDR was copying NET_6LOWPAN_ADDRSIZE bytes unconditionally. Depending on which radio is used, this could be incorrect. Fixing it to use `dev->d_mac.radio.nv_addrlen` for SIOCSIFHWADDR as well. Also adding DEBUGASSERT to ensure this is within bounds of source and destination of the copy. |
||
---|---|---|
.. | ||
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 | +----------------------------------------------------------------+ +--------------------------+