public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Davide Caratti <dcaratti@redhat.com>
Subject: Re: [PATCH iproute2-next] tc: m_ct: add support for helper
Date: Sat, 11 Feb 2023 09:21:39 -0800	[thread overview]
Message-ID: <20230211092139.5fb1078e@hermes.local> (raw)
In-Reply-To: <ab1e6bfbefff74b2b4fe230162b198c38cf5b394.1676065393.git.lucien.xin@gmail.com>

On Fri, 10 Feb 2023 16:43:13 -0500
Xin Long <lucien.xin@gmail.com> wrote:

> +static void ct_print_helper(struct rtattr *family, struct rtattr *proto, struct rtattr *name)
> +{
> +	char helper[32], buf[32], *n;
> +	int *f, *p;
> +
> +	if (!family || !proto || !name)
> +		return;
> +
> +	f = RTA_DATA(family);
> +	p = RTA_DATA(proto);
> +	n = RTA_DATA(name);
> +	sprintf(helper, "%s-%s-%s", (*f == AF_INET) ? "ipv4" : "ipv6",
> +		inet_proto_n2a(*p, buf, sizeof(buf)), n);

Please us snprintf to avoid possible string overflows

      parent reply	other threads:[~2023-02-11 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 21:43 [PATCH iproute2-next] tc: m_ct: add support for helper Xin Long
2023-02-11  1:20 ` Marcelo Ricardo Leitner
2023-02-11 17:21 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230211092139.5fb1078e@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dcaratti@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=lucien.xin@gmail.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox