Skip to content

Conversation

@masc2008
Copy link
Contributor

@masc2008 masc2008 commented Jan 28, 2026

Summary

It's like option "net.ipv4.conf.eth0.forwarding" in linux.
It's a useful setting if we need control ip forward by network interface level. Such like a LTE modem, a LTE modem usually has 3 net interfaces, while only one can be used data communication. It allows us configure the net device usage more flexible.

Impact

  • Nuttx support ipforward control, while it is a system level control for all network interfaces. This commit is to improve configure flexibility.
  • This need user application to enable a network interface forward capability. we can set ipfoward flag is enabled by default if we need to keep backward compatibility. it's a reasonable to choose ipforward flag disabled by default.
  • Impact on build (will build process change)? NO
  • Impact on hardware (will arch(s) / board(s) / driver(s) change)? NO
  • Impact on documentation (is update required / provided)? YES (If enable CONFIG_NET_IPFORWARD, need enable at least one net interface as "ipforward").
  • Impact on security (any sort of implications)? YES (This helps improve the security, since we choose specific net interface that can do ipforward, before the fwdev is choose by default.).
  • Impact on compatibility (backward/forward/interoperability)? YES (as mentioned above, it do changes some behavior, while it's something that deserve).

Testing

I confirm that changes are verified on local setup and works as intended:

  • Build Host(s): OS (Linux,BSD,macOS,Windows,..), CPU(Intel,AMD,ARM), compiler(GCC,CLANG,version), etc.
  • Target(s): ARM, BES chips.

Testing logs before change:

any device can be chosen as ipforward net interface.

Testing logs after change:

with this commit, only network interface with flag "IFF_FORWARD" can forward ip packet.

PR verification Self-Check

  • This PR introduces only one functional change.
  • I have updated all required description fields above.
  • My PR adheres to Contributing Guidelines and Documentation (git commit title and message, coding standard, etc).
  • My PR is still work in progress (not ready for review).
  • My PR is ready for review and can be safely merged into a codebase.

@github-actions github-actions bot added Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small labels Jan 28, 2026
*
****************************************************************************/

int ipforward_enable(FAR struct net_driver_s *dev)
Copy link
Contributor

Choose a reason for hiding this comment

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

where you call this function, please follow how IFUP get changed from userspace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could you give me more further info about this "how IFUP" get changed from userspace. is there any commit id or related topic for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you already have this one, I think this PR can be abandoned, thanks : )

Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

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

Please fill out the PR description according to the template + contributing guidelines.

It's like option "net.ipv4.conf.eth0.forwarding".
It's a useful setting if there are network interfaces like a lte modem.
A lte modem usually has 3 net interfaces, while only one can be used data
communication. It allows us configure the net device usage more flexible.

Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
@xiaoxiang781216
Copy link
Contributor

@masc2008 please review #18260 (review), which implement the similiar and more functionality.

@masc2008 masc2008 closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants