mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-19 13:51:11 +00:00
bridge: print_vlan: add missing check for json instance
Also initialize vlan_flags
Fixes: d82a49ce85
("bridge: add json support for bridge vlan show")
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
parent
4ecc96f8b6
commit
e40d6b2b90
@ -188,7 +188,7 @@ static int print_vlan(const struct sockaddr_nl *who,
|
|||||||
struct ifinfomsg *ifm = NLMSG_DATA(n);
|
struct ifinfomsg *ifm = NLMSG_DATA(n);
|
||||||
int len = n->nlmsg_len;
|
int len = n->nlmsg_len;
|
||||||
struct rtattr *tb[IFLA_MAX+1];
|
struct rtattr *tb[IFLA_MAX+1];
|
||||||
bool vlan_flags;
|
bool vlan_flags = false;
|
||||||
|
|
||||||
if (n->nlmsg_type != RTM_NEWLINK) {
|
if (n->nlmsg_type != RTM_NEWLINK) {
|
||||||
fprintf(stderr, "Not RTM_NEWLINK: %08x %08x %08x\n",
|
fprintf(stderr, "Not RTM_NEWLINK: %08x %08x %08x\n",
|
||||||
@ -276,7 +276,7 @@ static int print_vlan(const struct sockaddr_nl *who,
|
|||||||
fprintf(fp, " Egress Untagged");
|
fprintf(fp, " Egress Untagged");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vlan_flags) {
|
if (jw_global && vlan_flags) {
|
||||||
jsonw_end_array(jw_global);
|
jsonw_end_array(jw_global);
|
||||||
vlan_flags = false;
|
vlan_flags = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user