OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version openwrt-19.07
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Arnold - 15.03.2021

FS#3683 - jsonfilter yields unreliable results

- 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:
<code>ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface'</code>
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


   jinp1 (3.4 KiB)
   jinp2 (3.4 KiB)
Mikma commented on 17.05.2021 14:22

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

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing