netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: Jonas Bonn <jonas@norrbonn.se>
Cc: netdev@vger.kernel.org, pablo@netfilter.org, laforge@gnumonks.org
Subject: Re: [PATCH 2/5] gtp: include role in link info
Date: Thu, 3 Dec 2020 08:52:56 +0000	[thread overview]
Message-ID: <X8inaGuheZmfN1aG@azazel.net> (raw)
In-Reply-To: <20201202123345.565657-2-jonas@norrbonn.se>

[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]

On 2020-12-02, at 13:33:42 +0100, Jonas Bonn wrote:
> Querying link info for the GTP interface doesn't reveal in which
> "role" the
> device is set to operate.  Include this information in the info query
> result.
>
> Signed-off-by: Jonas Bonn <jonas@norrbonn.se>
> ---
>  drivers/net/gtp.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index 5a048f050a9c..096aaf1c867e 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
> @@ -728,7 +728,8 @@ static int gtp_validate(struct nlattr *tb[],
> struct nlattr *data[],
>
>  static size_t gtp_get_size(const struct net_device *dev)
>  {
> -	return nla_total_size(sizeof(__u32));	/* IFLA_GTP_PDP_HASHSIZE */
> +	return nla_total_size(sizeof(__u32)) +	/* IFLA_GTP_PDP_HASHSIZE */
> +		+ nla_total_size(sizeof(__u32)); /* IFLA_GTP_ROLE */

You have a '+' at the end of l.781 and another at the beginning of
l.782.

>  }
>
>  static int gtp_fill_info(struct sk_buff *skb, const struct net_device
> *dev)
> @@ -737,6 +738,8 @@ static int gtp_fill_info(struct sk_buff *skb,
> const struct net_device *dev)
>
>  	if (nla_put_u32(skb, IFLA_GTP_PDP_HASHSIZE, gtp->hash_size))
>  		goto nla_put_failure;
> +	if (nla_put_u32(skb, IFLA_GTP_ROLE, gtp->role))
> +		goto nla_put_failure;
>
>  	return 0;
>
> --
> 2.27.0
>
>

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-12-03  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 12:33 [PATCH 1/5] gtp: set initial MTU Jonas Bonn
2020-12-02 12:33 ` [PATCH 2/5] gtp: include role in link info Jonas Bonn
2020-12-03  8:52   ` Jeremy Sowden [this message]
2020-12-02 12:33 ` [PATCH 3/5] gtp: really check namespaces before xmit Jonas Bonn
2020-12-02 12:33 ` [PATCH 4/5] gtp: drop unnecessary call to skb_dst_drop Jonas Bonn
2020-12-02 12:33 ` [PATCH 5/5] gtp: set device type Jonas Bonn

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=X8inaGuheZmfN1aG@azazel.net \
    --to=jeremy@azazel.net \
    --cc=jonas@norrbonn.se \
    --cc=laforge@gnumonks.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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).