Subject: Re: [iproute2-next v1] seg6: add support for flavors in SRv6 End* behaviors

From: Stephen Hemminger <[email-masked]>
Date: Sun, 12 Jun 2022 09:10:19 -0700

On Sat, 11 Jun 2022 13:06:45 +0200
Paolo Lungaroni <[email-masked]> wrote:

> +	strlcpy(wbuf, buf, SEG6_LOCAL_FLV_BUF_SIZE);
> +	wbuf[SEG6_LOCAL_FLV_BUF_SIZE - 1] = 0;
> +
> +	if (strlen(wbuf) == 0)
> +		return -1;

If you use strdupa() then you don't have to worry about buffer sizes.

+			else {
+				if (fnumber++ == 0)
+					fprintf(fp, "%s", flv_name);
+				else
+					fprintf(fp, ",%s", flv_name);
+			}

Minor nits. I am trying to get rid of use of passing fp around
and just use print_string() everywhere. That way can do quick scan
for places still using 'fprintf(fp' as indicator of old code
that was never updated to use JSON.

Also, it looks the output of multiple flavors does not match
the input command line for multiple flavors.