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
| ||
|
Date: Fri, 2 Oct 2020 12:26:09 +0200 From: Johannes Berg <johannes@...solutions.net> To: netdev@...r.kernel.org Cc: Jakub Kicinski <kuba@...nel.org>, David Ahern <dsahern@...il.com> Subject: [PATCH] genl: ctrl: print op -> policy idx mapping Newer kernels can dump per-op policies, so print out the new mapping attribute to indicate which op has which policy. Signed-off-by: Johannes Berg <johannes@...solutions.net> --- genl/ctrl.c | 10 ++++++++++ include/uapi/linux/genetlink.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/genl/ctrl.c b/genl/ctrl.c index 68099fe97f1a..c62212b40fa3 100644 --- a/genl/ctrl.c +++ b/genl/ctrl.c @@ -162,6 +162,16 @@ static int print_ctrl(struct rtnl_ctrl_data *ctrl, __u32 *ma = RTA_DATA(tb[CTRL_ATTR_MAXATTR]); fprintf(fp, " max attribs: %d ",*ma); } + if (tb[CTRL_ATTR_OP_POLICY]) { + const struct rtattr *pos; + + rtattr_for_each_nested(pos, tb[CTRL_ATTR_OP_POLICY]) { + __u32 *v = RTA_DATA(pos); + + fprintf(fp, " op %d has policy %d", + pos->rta_type, *v); + } + } if (tb[CTRL_ATTR_POLICY]) nl_print_policy(tb[CTRL_ATTR_POLICY], fp); diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h index 7c6c390c48ee..adb59b9fb9a3 100644 --- a/include/uapi/linux/genetlink.h +++ b/include/uapi/linux/genetlink.h @@ -64,6 +64,8 @@ enum { CTRL_ATTR_OPS, CTRL_ATTR_MCAST_GROUPS, CTRL_ATTR_POLICY, + CTRL_ATTR_OP, + CTRL_ATTR_OP_POLICY, __CTRL_ATTR_MAX, }; -- 2.26.2
Powered by blists - more mailing lists