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] [day] [month] [year] [list]
Date:   Mon, 24 Apr 2017 10:43:10 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     Jiri Kosina <jikos@...nel.org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Stephen Hemminger <stephen@...workplumber.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Phil Sutter <phil@....cc>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Daniel Borkmann <daniel@...earbox.net>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] iproute2: add support for invisible qdisc dumping

Wed, Mar 08, 2017 at 01:04:42PM CET, jikos@...nel.org wrote:
>From: Jiri Kosina <jkosina@...e.cz>
>
>Support the new TCA_DUMP_INVISIBLE netlink attribute that allows asking 
>kernel to perform 'full qdisc dump', as for historical reasons some of the 
>default qdiscs are being hidden by the kernel.
>
>The command syntax is being extended by voluntary 'invisible' argument to
>'tc qdisc show'.
>
>Signed-off-by: Jiri Kosina <jkosina@...e.cz>
>---

[...]


>@@ -325,7 +328,25 @@ static int tc_qdisc_list(int argc, char **argv)
> 		filter_ifindex = t.tcm_ifindex;
> 	}
> 
>-	if (rtnl_dump_request(&rth, RTM_GETQDISC, &t, sizeof(t)) < 0) {
>+	if (dump_invisible) {
>+		struct {
>+			struct nlmsghdr n;
>+			struct tcmsg t;
>+			char buf[256];
>+		} req = {
>+			.n.nlmsg_type = RTM_GETQDISC,
>+			.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)),
>+		};
>+
>+		req.t.tcm_family = AF_UNSPEC;
>+
>+		addattr(&req.n, 256, TCA_DUMP_INVISIBLE);
>+		if (rtnl_dump_request_n(&rth, &req.n) < 0) {

Jirko, you ignore the values that were previously set in "t". I think
that you can change this to do rtnl_dump_request_n always and simplify
the code a bit.


>+			perror("Cannot send dump request");
>+			return 1;
>+		}
>+
>+	} else if (rtnl_dump_request(&rth, RTM_GETQDISC, &t, sizeof(t)) < 0) {
> 		perror("Cannot send dump request");
> 		return 1;
> 	}
>-- 
>Jiri Kosina
>SUSE Labs
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ