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:   Wed, 5 Feb 2020 04:22:39 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Xin Long <lucien.xin@...il.com>
Cc:     network dev <netdev@...r.kernel.org>,
        Simon Horman <simon.horman@...ronome.com>,
        Pieter Jansen van Vuuren 
        <pieter.jansenvanvuuren@...ronome.com>
Subject: Re: [PATCH iproute2-next 2/7] iproute_lwtunnel: add options support
 for vxlan metadata

On Mon,  3 Feb 2020 13:39:53 +0800
Xin Long <lucien.xin@...il.com> wrote:

> +static void lwtunnel_print_vxlan_opts(struct rtattr *attr, char *opt)
> +{
> +	struct rtattr *tb[LWTUNNEL_IP_OPT_VXLAN_MAX + 1];
> +	__u32 gbp;
> +
> +	parse_rtattr(tb, LWTUNNEL_IP_OPT_VXLAN_MAX, RTA_DATA(attr),
> +		     RTA_PAYLOAD(attr));
> +	gbp = rta_getattr_u32(tb[LWTUNNEL_IP_OPT_VXLAN_GBP]);
> +	sprintf(opt, "%x", gbp);
> +	print_string(PRINT_FP, "enc_opt", "\n  vxlan_opts %s ", opt);

You need to handle single line mode and JSON.

Proper way is something like:

	print_nl();
	print_0xhex(PRINT_ANY, "enc_opt", "  vxlan_opts %#x", gpb);

Also, why the hex format, this is a an opaque user interface?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ