From: David Ahern <dsahern@gmail.com>
To: Serhey Popovych <serhe.popovych@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next 3/3] iptnl/ip6tnl: Unify local/remote endpoint and 6rd address parsing
Date: Sat, 10 Feb 2018 09:48:01 -0700 [thread overview]
Message-ID: <dd9d3067-9083-1464-78ea-89983e8e7aa8@gmail.com> (raw)
In-Reply-To: <1518199563-16182-4-git-send-email-serhe.popovych@gmail.com>
On 2/9/18 11:06 AM, Serhey Popovych wrote:
> @@ -289,29 +293,16 @@ get_failed:
> } else if (strcmp(*argv, "external") == 0) {
> metadata = 1;
> } else if (strcmp(*argv, "6rd-prefix") == 0) {
> - inet_prefix prefix;
> -
> NEXT_ARG();
> - if (get_prefix(&prefix, *argv, AF_INET6))
> + if (get_prefix(&ip6rdprefix, *argv, AF_INET6))
> invarg("invalid 6rd_prefix\n", *argv);
> - memcpy(&ip6rdprefix, prefix.data, 16);
> - ip6rdprefixlen = prefix.bitlen;
> } else if (strcmp(*argv, "6rd-relay_prefix") == 0) {
> - inet_prefix prefix;
> -
> NEXT_ARG();
> - if (get_prefix(&prefix, *argv, AF_INET))
> + if (get_prefix(&ip6rdrelayprefix, *argv, AF_INET))
> invarg("invalid 6rd-relay_prefix\n", *argv);
> - memcpy(&ip6rdrelayprefix, prefix.data, 4);
> - ip6rdrelayprefixlen = prefix.bitlen;
> } else if (strcmp(*argv, "6rd-reset") == 0) {
> - inet_prefix prefix;
> -
> - get_prefix(&prefix, "2002::", AF_INET6);
> - memcpy(&ip6rdprefix, prefix.data, 16);
> - ip6rdprefixlen = 16;
> - ip6rdrelayprefix = 0;
> - ip6rdrelayprefixlen = 0;
> + get_prefix(&ip6rdprefix, "2002::/16", AF_INET6);
> + ip6rdrelayprefix.flags = 0;
> } else if (strcmp(*argv, "fwmark") == 0) {
> NEXT_ARG();
> if (get_u32(&fwmark, *argv, 0))
I spent far too long staring at the patches to verify you are not
breaking anything. A key reason is the reset of inet_prefix.flags to 0.
That is a low-level detail that needs a properly named helper to make it
clear you are resetting the address to uninitialized.
That is needed in all of the places you have 'inet_prefix.flags = 0;' in
these.
prev parent reply other threads:[~2018-02-10 16:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 18:06 [PATCH iproute2-next 0/3] ip/tunnel: Unify local/remote endpoint address parsing Serhey Popovych
2018-02-09 18:06 ` [PATCH iproute2-next 1/3] vti/vti6: " Serhey Popovych
2018-02-09 18:06 ` [PATCH iproute2-next 2/3] gre/gre6: " Serhey Popovych
2018-02-09 18:06 ` [PATCH iproute2-next 3/3] iptnl/ip6tnl: Unify local/remote endpoint and 6rd " Serhey Popovych
2018-02-10 16:48 ` David Ahern [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=dd9d3067-9083-1464-78ea-89983e8e7aa8@gmail.com \
--to=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=serhe.popovych@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;
as well as URLs for NNTP newsgroup(s).