Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for network interface user friendly name #61876

Merged
merged 4 commits into from Aug 31, 2023

Conversation

jukkar
Copy link
Member

@jukkar jukkar commented Aug 25, 2023

If CONFIG_NET_INTERFACE_NAME is enabled (default is y), then the system will automatically set a user friendly name to the network interface like eth0, wlan0 etc. Application can change the interface name if needed.

This is useful so that applications do not need to try to use the device name for figuring out the desired network interface.

Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor comments. I think it'd make sense to update the SO_BINDTODEVICE implementation as well, for now it relies on the device name, but it should use the interface name instead I believe.

include/zephyr/net/net_if.h Show resolved Hide resolved
subsys/net/ip/net_if.c Outdated Show resolved Hide resolved
subsys/net/ip/net_if.c Show resolved Hide resolved
subsys/net/ip/net_if.c Show resolved Hide resolved
subsys/net/ip/net_if.c Outdated Show resolved Hide resolved
subsys/net/ip/net_if.c Outdated Show resolved Hide resolved
@zephyrbot zephyrbot added the area: Sockets Networking sockets label Aug 25, 2023
@jukkar jukkar force-pushed the network-interface-name branch 3 times, most recently from 8c2e894 to c252d8b Compare August 25, 2023 13:20
rlubos
rlubos previously approved these changes Aug 25, 2023
Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

rlubos
rlubos previously approved these changes Aug 25, 2023
If CONFIG_NET_INTERFACE_NAME is enabled (default is y), then
system will automatically set a user friendly name to the network
interface like eth0, wlan0 etc.
Application can change the interface name if needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Check that we can set and get the network interface name.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure we use the network interface name (if configured)
instead of device name when binding to certain network
interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If network interface name support is enabled, print the name
when showing network interface data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
@jukkar
Copy link
Member Author

jukkar commented Aug 31, 2023

Increased the max name length to 15 chars.

@carlescufi carlescufi merged commit 8c573d6 into zephyrproject-rtos:main Aug 31, 2023
18 checks passed
@jukkar jukkar deleted the network-interface-name branch August 31, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants