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

net/netdev: Modify the logic for setting the IFF_RUNNING status of interfaces. #11396

Merged
merged 1 commit into from Dec 16, 2023

Conversation

liqinhuixm
Copy link
Contributor

Summary

Modify the logic for setting the IFF_RUNNING status of interfaces.
Refer to the logic of the netif_carrier_on on linux.
https://github.com/torvalds/linux/blob/master/net/sched/sch_generic.c#L575

Impact

N/A

Testing

When we set the eth0 interface with the commands ifup eth0 (or ifdown eth0)continuously on emulator.
And no error is returned.

net/netdev/netdev_carrier.c Outdated Show resolved Hide resolved
…terfaces.

Refer to the logic of the `netif_carrier_on` on linux.
https://github.com/torvalds/linux/blob/master/net/sched/sch_generic.c#L575

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
struct wlan_priv_s *priv = &g_wlan_priv[ESP32S3_WLAN_STA_DEVNO];

if (priv != NULL)
if (linkstatus == true)
Copy link
Contributor

Choose a reason for hiding this comment

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

why remov the null check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The priv cann't be NULL. Becasue the g_wlan_priv is an array of struct wlan_priv_s.

struct wlan_priv_s *priv = &g_wlan_priv[ESP32C3_WLAN_STA_DEVNO];

if (priv != NULL)
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

@xiaoxiang781216 xiaoxiang781216 merged commit 98e3615 into apache:master Dec 16, 2023
26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.4.0 Dec 27, 2023
@jerpelea jerpelea moved this from To-Add to Net in Release Notes - 12.4.0 Jan 8, 2024
@jerpelea jerpelea moved this from Net to processed in Release Notes - 12.4.0 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants