lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 Feb 2019 21:50:19 +0100
From:   Thomas Haller <thaller@...hat.com>
To:     netdev@...r.kernel.org
Cc:     stephen@...workplumber.org, Thomas Haller <thaller@...hat.com>
Subject: [PATCH iproute2, v2] ip-rule: fix json key "to_tbl" for unspecific rule action

The key should not be called "to_tbl" because it is exactly
not a FR_ACT_TO_TBL action. Change it to "action".

    # ip rule add blackhole
    # ip -j rule | python -m json.tool
    ...
    {
        "priority": 0,
        "src": "all",
        "to_tbl": "blackhole"
    },

This is an API break of JSON output as it was added in v4.17.0.
Still change it as the API is relatively new and unstable.

Fixes: 0dd4ccc56c0e ("iprule: add json support")

Signed-off-by: Thomas Haller <thaller@...hat.com>
---
 ip/iprule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ip/iprule.c b/ip/iprule.c
index 2f58d8c2..4e9437de 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -459,7 +459,7 @@ int print_rule(struct nlmsghdr *n, void *arg)
 	} else if (frh->action == FR_ACT_NOP) {
 		print_null(PRINT_ANY, "nop", "nop", NULL);
 	} else if (frh->action != FR_ACT_TO_TBL) {
-		print_string(PRINT_ANY, "to_tbl", "%s",
+		print_string(PRINT_ANY, "action", "%s",
 			     rtnl_rtntype_n2a(frh->action, b1, sizeof(b1)));
 	}
 
-- 
2.20.1

Powered by blists - more mailing lists