bmx-routing / bmx7

BMX7 / SEMTOR Securely Entrusted Mesh Routing Protocol
GNU General Public License v2.0
63 stars 15 forks source link

bmx7-info calls returns an invalid JSON structure when no interfaces are configured or no links are established #38

Closed rogerpueyo closed 5 years ago

rogerpueyo commented 5 years ago

Certain bmx7-info calls from the web interface (e.g., https://192.168.1.1/cgi-bin/bmx7-info?$info) return an invalid JSON structure with two consecutive commas. This happens when there are no interfaces configured to be used, or when no links can be established to other routers.

Take, for instance, this example, with two commas just before the memory block:

    "info": [{
        "status": {
            "shortId": "EE598CB5",
            etc.
        }
    }, {
        "interfaces": [{
            "dev": "br-lan",
            "state": "UP",
            etc.
        }, {
            "dev": "eth1",
            "state": "UP",
            etc.
        }]
    }, , {
        "memory": {
            "bmx7": "2388 kB"
        }
    }]
}
rogerpueyo commented 5 years ago

The bmx7-info file actually belongs to openwrt-routing. Moved to https://github.com/openwrt-routing/packages/issues/430