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

wireguard-tools: call jsonfilter just once #12344

Closed
wants to merge 3 commits into from

Conversation

riobard
Copy link

@riobard riobard commented Apr 7, 2023

Eliminate the extra call to jsonfilter to enumerate active WireGuard interfaces to avoid potential bugs and be more efficient.

This change was originally proposed by @pputerla in #11649 as a workaround for #8703. Since 22.03.2 the issue seems to be fixed so @pputerla closed the pull request, but I think it's still very worth it as it is more efficient and robust.

Eliminate the extra call to jsonfilter to enumerate active WireGuard
interfaces to avoid potential bugs and be more efficient.

This change was originally proposed by @pputerla in openwrt#11649 as a
workaround for openwrt#8703. Since 22.03.2 the issue seems to be fixed so
@pputerla closed the pull request, but I think it's still very worth it as
it is more efficient and robust.

Signed-off-by: Rio <riobard@users.noreply.github.com>
@github-actions github-actions bot added the core packages pull request/issue for core (in-tree) packages label Apr 7, 2023
@aparcar
Copy link
Member

aparcar commented Apr 18, 2023

@riobard please see the CI complaining about formalities.

@riobard
Copy link
Author

riobard commented Apr 18, 2023

@aparcar Thanks for the reminder! As I see it, the only complain is about lacking my real name. Is it strictly required? I do not want to reveal my real name here due to privacy and safety concerns. I also do not intend to claim any originality of the contribution since it is clearly stated in the commit message that it's someone else's abandoned pull request. I'll be completely fine if someone else can submit the commit instead. Please advise. Thanks!

@jow-
Copy link
Contributor

jow- commented Jan 23, 2024

Please use the following expression, this will also eliminate the need for the tr call:

eval $(ubus -S call network.interface dump | jsonfilter -e 'wg_ifaces=@.interface[@.up=true && @.proto="wireguard"].interface')

openwrt-bot pushed a commit that referenced this pull request Jan 23, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: #8703
Fixes: #11649
Fixes: #12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 33f15dd)
openwrt-bot pushed a commit that referenced this pull request Jan 23, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: #8703
Fixes: #11649
Fixes: #12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 33f15dd)
openwrt-bot pushed a commit that referenced this pull request Jan 23, 2024
Use a single jsonfilter expression to yield the list of logical wireguard
interface names in shell compatible notation.

Supersedes: #12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
HiGarfield pushed a commit to HiGarfield/lede-17.01.4-Mod that referenced this pull request Jan 23, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: openwrt/openwrt#8703
Fixes: openwrt/openwrt#11649
Fixes: openwrt/openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Jan 25, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: openwrt#8703
Fixes: openwrt#11649
Fixes: openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Jan 25, 2024
Use a single jsonfilter expression to yield the list of logical wireguard
interface names in shell compatible notation.

Supersedes: openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
db260179 pushed a commit to db260179/openwrt that referenced this pull request Jan 31, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: openwrt#8703
Fixes: openwrt#11649
Fixes: openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
db260179 pushed a commit to db260179/openwrt that referenced this pull request Jan 31, 2024
Use a single jsonfilter expression to yield the list of logical wireguard
interface names in shell compatible notation.

Supersedes: openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
sbeach92 pushed a commit to sbeach92/openwrt that referenced this pull request Feb 16, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: openwrt#8703
Fixes: openwrt#11649
Fixes: openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
sbeach92 pushed a commit to sbeach92/openwrt that referenced this pull request Feb 16, 2024
Use a single jsonfilter expression to yield the list of logical wireguard
interface names in shell compatible notation.

Supersedes: openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
rondoval pushed a commit to rondoval/openwrt that referenced this pull request Feb 25, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: openwrt#8703
Fixes: openwrt#11649
Fixes: openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 33f15dd)
Zack0617 pushed a commit to Zack0617/openwrt that referenced this pull request Mar 25, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: openwrt/openwrt#8703
Fixes: openwrt/openwrt#11649
Fixes: openwrt/openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 33f15dd6d41873b02eb8895b8886763659f1390c)
Zack0617 pushed a commit to Zack0617/openwrt that referenced this pull request Mar 25, 2024
013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: openwrt/openwrt#8703
Fixes: openwrt/openwrt#11649
Fixes: openwrt/openwrt#12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 33f15dd6d41873b02eb8895b8886763659f1390c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core packages pull request/issue for core (in-tree) packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants