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

FS#3683 - jsonfilter yields unreliable results #8703

Closed
openwrt-bot opened this issue Mar 15, 2021 · 2 comments
Closed

FS#3683 - jsonfilter yields unreliable results #8703

openwrt-bot opened this issue Mar 15, 2021 · 2 comments
Labels
flyspray release/19.07

Comments

@openwrt-bot
Copy link

@openwrt-bot openwrt-bot commented Mar 15, 2021

arnysch:

  • Device is an Arcadyan VGV7510KW22 (o2 Box 6431)
  • Box software version is OpenWrt 19.07-SNAPSHOT, r11318-c64742a96e
  • Problem shows up in package wireguard_tool which provides script wireguard_watchdog" which uses jsonfilter.
  • Short steps to reproduce:
  • Use attached file jinp1 as input and run this command:
    jsonfilter -a -e '@[@.proto="wireguard"].interface' <jout1
    => nothing is output (empty output), which is incorrect

  • Now use attached file jinp2, which is jinp1 with lines slighty reordered:
    jsonfilter -a -e '@[@.proto="wireguard"].interface' <jout2
    => "wgvpn" is output, which is correct, this time.

  • Background: Script wireguard_watchdog tries to identify the WireGuard network interfaces.
    To this end it runs these commands:
    ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface'
    The second jsonfilter call in this line erroneously does not show a result.
    The attached files jinp1, jinp2 contain example input for the 2nd jsonfilter call
@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented May 17, 2021

mikma:

The problem is caused by a bug in the array parsing. It can be solved with the following patch.

https://patchwork.ozlabs.org/project/openwrt/list/?series=244999

@aparcar aparcar added the release/19.07 label Feb 22, 2022
@ynezz
Copy link
Member

@ynezz ynezz commented May 24, 2022

OpenWrt 19.07 release is EOL, try to reproduce the issue with latest supported release and feel free to ask for issue reopening if the problem is still present, thanks.

@ynezz ynezz closed this as completed May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray release/19.07
Projects
None yet
Development

No branches or pull requests

3 participants