You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/15 14:45:10 UTC
[GitHub] [incubator-nuttx] hartmannathan opened a new pull request, #7101: net: Fix sa_family returned by SIOCGIFHWADDR
hartmannathan opened a new pull request, #7101:
URL: https://github.com/apache/incubator-nuttx/pull/7101
## Summary
The ioctl `SIOCGIFHWADDR` provides the hardware address (e.g., Ethernet MAC, etc.) of a network interface. It is based on Linux. (BSD-based systems don't have this ioctl.)
The Linux implementation sets `sa_family` to `ARPHRD_ETHER` for Ethernet and IEEE 802.11 interfaces [1].
NuttX was setting it to `NET_SOCK_FAMILY` for these interface types as well as 6LoWPAN and PKTRADIO; this was incorrect and also the value of `NET_SOCK_FAMILY` varies based on Kconfig settings. For example, in my build, `NET_SOCK_FAMILY` equals 2 while `ARPHRD_ETHER` equals 1, causing software to fail.
Correcting this to `ARPHRD_ETHER` for Ethernet and IEEE 802.11 and `ARPHRD_IEEE802154` for 6LoWPAN and PKTRADIO.
References:
[1] ['man 7 netdevice'](https://man7.org/linux/man-pages/man7/packet.7.html) on Linux: "SIOCGIFHWADDR... sa_family` contains the ARPHRD_* device type..."
[2] Mailing list thread "Bug - SIOCGIFHWADDR?" started 14 Sept 2022, archived: [https://lists.apache.org/thread/1m6nzv7xltfm1rpjgfcm486p57jgl2ct](https://lists.apache.org/thread/1m6nzv7xltfm1rpjgfcm486p57jgl2ct)
## Impact
Consistency with the expectations of software that uses this ioctl.
## Testing
Ported application running on custom board.
Build testing.
nxstyle.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7101: net: Fix sa_family returned by SIOCGIFHWADDR
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7101:
URL: https://github.com/apache/incubator-nuttx/pull/7101
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org