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:   Thu, 30 May 2019 11:55:45 -0600
From:   David Ahern <dsahern@...il.com>
To:     Stephen Hemminger <stephen@...workplumber.org>,
        David Ahern <dsahern@...nel.org>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

On 5/30/19 11:52 AM, Stephen Hemminger wrote:
> On Wed, 29 May 2019 20:17:44 -0700
> David Ahern <dsahern@...nel.org> wrote:
> 
>> +
>> +static void print_nh_gateway(FILE *fp, const struct nhmsg *nhm,
>> +			      const struct rtattr *rta)
>> +{
>> +	const char *gateway = format_host_rta(nhm->nh_family, rta);
>> +
>> +	if (is_json_context())
>> +		print_string(PRINT_JSON, "gateway", NULL, gateway);
>> +	else {
>> +		fprintf(fp, "via ");
> 
> I was trying to get rid of all use of /fprintf(fp, / since it was
> indication of non-json code and fp is always stdout.
> 
> Maybe
> 	print_string(PRINT_FP, NULL, "via ", NULL);
> 	print_color_string(PRINT_ANY, ifa_family_color(nhm->nh_family),
> 			"gateway", "%s ", format_host_rta(nhm->nh_family, rta));
> 
> 
> 			   
> 

The above is consistent with print_rta_gateway in ip/iproute.c. Since
the only difference between the 2 is the header struct, I will change
print_rta_gateway to take the address family over rtmsg and re-use it
for both paths.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ