Subject: Re: [PATCH iproute2-next] iproute2: ss: add support to expose various inet sockopts

From: Stephen Hemminger <[email-masked]>
Date: Tue, 18 Aug 2020 22:45:53 -0700

On Tue, 18 Aug 2020 16:17:19 -0700
Wei Wang <[email-masked]> wrote:

> +			if (!oneline)
> +				out("\n\tinet-sockopt: (");
> +			else
> +				out(" inet-sockopt: (");
> +			out("recverr: %d, ", sockopt->recverr);
> +			out("is_icsk: %d, ", sockopt->is_icsk);
> +			out("freebind: %d, ", sockopt->freebind);
> +			out("hdrincl: %d, ", sockopt->hdrincl);
> +			out("mc_loop: %d, ", sockopt->mc_loop);
> +			out("transparent: %d, ", sockopt->transparent);
> +			out("mc_all: %d, ", sockopt->mc_all);
> +			out("nodefrag: %d, ", sockopt->nodefrag);
> +			out("bind_addr_no_port: %d, ", sockopt->bind_address_no_port);
> +			out("recverr_rfc4884: %d, ", sockopt->recverr_rfc4884);
> +			out("defer_connect: %d", sockopt->defer_connect);

Since these are all boolean options why not just print them only if on?
That saves space and makes more compact output.

			if (sockopt->recverr) out("recverr, ");