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

cmds_gnrc_netif: Support enabling/disabling lwIP netifs from gnrc_netif shell #19972

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

yarrick
Copy link
Contributor

@yarrick yarrick commented Oct 11, 2023

Contribution description

Similar to Linux, lwIP has separate link and interface statuses.
This change expose this in a netopt and updates gnrc ifconfig to show and set it.

I am not really happy with the NETOPT_ACTIVE name. Maybe NETOPT_STATE could be renamed to NETOPT_RF_STATE?

The code for setting up/down is not very nice. Not sure if link state will be controllable in lwIP - maybe for 6lowpan radios.

Testing procedure

Flash tests/pkg/lwip . Any traffic received while the interface is down is dropped.

> ifconfig
Iface  ET0  HWaddr: 24:0A:C4:E6:0E:9F  Link: up  State: up 
          L2-PDU:1500  Source address length: 6
          Link type: wired
          inet6 addr: fe80::260a:c4ff:fee6:e9f  scope: link
          
> ifconfig ET0 down
> ifconfig
Iface  ET0  HWaddr: 24:0A:C4:E6:0E:9F  Link: up  State: down 
          L2-PDU:1500  Source address length: 6
          Link type: wired
          inet6 addr: fe80::260a:c4ff:fee6:e9f  scope: link
          
> ifconfig ET0 up

Issues/PRs references

This only makes a difference when gnrc_netif ifconfig command is used. For that it depends on #19971 and an extra change like 7160ed9 to replace lwip netif with the gnrc version.

@github-actions github-actions bot added Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System labels Oct 11, 2023
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Looking good

@miri64 miri64 added State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Oct 12, 2023
@riot-ci
Copy link

riot-ci commented Oct 12, 2023

Murdock results

✔️ PASSED

726e2eb sys/shell/gnrc_netif: Set lwIP netif state on up/down

Success Failures Total Runtime
7937 0 7937 14m:38s

Artifacts

@miri64
Copy link
Member

miri64 commented Oct 12, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 12, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 3a4ec8d into RIOT-OS:master Oct 12, 2023
28 of 30 checks passed
@miri64 miri64 changed the title RFC: Support enabling/disabling lwIP netifs from gnrc_netif shell cmds_gnrc_netif: Support enabling/disabling lwIP netifs from gnrc_netif shell Oct 13, 2023
@yarrick yarrick deleted the netif_up branch October 13, 2023 17:30
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.10 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants