Skip to content

Conversation

@l-jonas
Copy link

@l-jonas l-jonas commented Nov 2, 2025

📦 Package Details

Maintainer: @feckert

Description:

It is possible for the source IP to change without an ifup event. As the USR1 and USR2 signal are already used for ifup and ifdown, there is no possibility to add another trigger for refreshing the source IP only.

When receiving an ifup, then the source IP is refreshed. However, in addition to that, the current interface state is set to the assumed initial interface state which is an unwanted side effect in this case.

This patch refreshes the source IP during every iteration of the main loop, that is all sleep_time seconds where sleep_time is by default ten seconds. There is one mwan3track process per interface. Thus, I make the assumption that this does not cause a noticable amount of extra system load.


🧪 Run Testing Details

  • OpenWrt Version: 24.10.2
  • OpenWrt Target/Subtarget: x86/64
  • OpenWrt Device: KVM virtual machine

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

It is possible for the source IP to change without an ifup event. As the
USR1 and USR2 signal are already used for ifup and ifdown, there is no
possibility to add another trigger for refreshing the source IP only.

When receiving an ifup, then the source IP is refreshed. However, in
addition to that, the current interface state is set to the assumed
initial interface state which is an unwanted side effect in this case.

This patch refreshes the source IP during every iteration of the main
loop, that is all sleep_time seconds where sleep_time is by default
ten seconds. There is one mwan3track process per interface. Thus, I
make the assumption that this does not cause a noticable amount of
extra system load.

Signed-off-by: Jonas Lochmann <[email protected]>
}
sleep_time=$interval
network_flush_cache
mwan3_get_src_ip SRC_IP $INTERFACE
Copy link
Member

Choose a reason for hiding this comment

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

I think we should move the call of network_flush_cache into the function mwan3_get_src_ip. If some in the future needs the function mwan3_get_src_ip anywere else in mwan3. The developer needs to know that the function network_flush_cache needs to be called first to get the latest SRPC_IP value.

We also call this function there

mwan3_get_src_ip src_ip $interface
too.

Copy link
Author

Choose a reason for hiding this comment

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

I disagree with that. The other place where this is used in mwan3track (in firstconnect), there is also the manual call to network_flush_cache. This only refers to a cache within the bash script.

mwan3 use is short running/only calls the function once. Thus, there is no moment where this could be refreshed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants