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

strongswan: swanctl: make overtime and send_cert vars local #25474

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kevinoid
Copy link

@kevinoid kevinoid commented Dec 1, 2024

Maintainer: @pprindeville @Thermi
Compile tested: None. Script only change.
Run tested: aarch64, Linksys E8450 mediatek/mt7622, OpenWrt 23.05.5, checked generated swanctl.conf and operation

Description:
Both $overtime and $send_cert are only used in config_remote() in swanctl.init. However, unlike the other local option variables, they are not declared local. This PR does so for consistency, to avoid global namespace pollution, and make the code easier to reason about.

For reference, $overtime was added in f9d91f1, $send_cert in 4b9453b.

Thanks for considering,
Kevin

When support for send_cert was added in 4b9453b, the $send_cert
variable was inadvertently global.  Make it local to avoid polluting the
global namespace and make the code easier to reason about.

Fixes: 4b9453b ("strongswan: Add support for send_cert option")
Signed-off-by: Kevin Locke <[email protected]>
$overtime has been used since swanctl.init was added in f9d91f1.
However, there's no need for it to be global.  Make it local like the
other config variables to avoid polluting the global namespace and make
the code easier to reason about.

Fixes: f9d91f1 ("strongswan: migrate to swanctl configs")
Signed-off-by: Kevin Locke <[email protected]>
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