Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: "Jörg Thalheim" <joerg@thalheim.io>
Cc: "wireguard@lists.zx2c4.com" <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH] wg: correct type for CTRL_ATTR_FAMILY_ID
Date: Tue, 31 Oct 2017 10:19:23 +0100	[thread overview]
Message-ID: <CAHmME9pQuq2ntj-yUi9PnqzzzPpLKq=bW9U2DDUTtmvT=5GH0Q@mail.gmail.com> (raw)
In-Reply-To: <462fb5c1-0832-a394-8839-d9b54bcb13fa@thalheim.io>

Hey J=C3=B3rg,

Thanks for the patch. This seems correct to me. From net/netlink/genetlink.=
c:

static const struct nla_policy ctrl_policy[CTRL_ATTR_MAX+1] =3D {
       [CTRL_ATTR_FAMILY_ID]   =3D { .type =3D NLA_U16 },

So I'll apply it.

However, the reason it was like this is because I lifted most of that
file from iproute2:
https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git/tre=
e/devlink/mnlg.c

I suspect the reason it's like this is because the original intention
was to use the same field for CTRL_ATTR_MCAST_GRP_ID, which eventually
got made into struct group_info instead.

Can you send this upstream too? You'll want to send it to
jiri@mellanox.com, stephen@networkplumber.org, and
netdev@vger.kernel.org, and put me in the CC.

Thanks,
Jason

On Tue, Oct 31, 2017 at 9:55 AM, J=C3=B6rg Thalheim <joerg@thalheim.io> wro=
te:
> Signed-off-by: Joerg Thalheim <joerg@thalheim.io>
> ---
>  src/tools/mnlg.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/tools/mnlg.c b/src/tools/mnlg.c
> index 9135651..5ac72e2 100644
> --- a/src/tools/mnlg.c
> +++ b/src/tools/mnlg.c
> @@ -19,7 +19,7 @@
>  struct mnlg_socket {
>         struct mnl_socket *nl;
>         char *buf;
> -       uint32_t id;
> +       uint16_t id;
>         uint8_t version;
>         unsigned int seq;
>         unsigned int portid;
> @@ -206,7 +206,7 @@ int mnlg_socket_group_add(struct mnlg_socket *nlg, co=
nst char *group_name)
>         nlh =3D __mnlg_msg_prepare(nlg, CTRL_CMD_GETFAMILY,
>                                  NLM_F_REQUEST | NLM_F_ACK, GENL_ID_CTRL,=
 1);
> -       mnl_attr_put_u32(nlh, CTRL_ATTR_FAMILY_ID, nlg->id);
> +       mnl_attr_put_u16(nlh, CTRL_ATTR_FAMILY_ID, nlg->id);
>         err =3D mnlg_socket_send(nlg, nlh);
>         if (err < 0)
> --
> 2.14.3
>
> _______________________________________________
> WireGuard mailing list
> WireGuard@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard

  parent reply	other threads:[~2017-10-31  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31  8:55 Jörg Thalheim
2017-10-31  9:00 ` Jörg Thalheim
2017-10-31  9:19 ` Jason A. Donenfeld [this message]
2017-10-31 13:52   ` Jason A. Donenfeld
2017-10-31 13:57     ` Jason A. Donenfeld

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='CAHmME9pQuq2ntj-yUi9PnqzzzPpLKq=bW9U2DDUTtmvT=5GH0Q@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=joerg@thalheim.io \
    --cc=wireguard@lists.zx2c4.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).