diff mbox series

[SRU,F/B,1/1] gtp: add GTPA_LINK info to msg sent to userspace

Message ID 20200916153207.28740-2-william.gray@canonical.com
State New
Headers show
Series gtp: add GTPA_LINK info to msg sent to userspace | expand

Commit Message

William Breathitt Gray Sept. 16, 2020, 3:32 p.m. UTC
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>

BugLink: https://bugs.launchpad.net/bugs/1894605

During a dump, this attribute is essential, it enables the userspace to
know on which interface the context is linked to.

Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Tested-by: Gabriel Ganne <gabriel.ganne@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b274e47d9e3f4dcd4ad4028a316ec22dc4533ac7)
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
---
 drivers/net/gtp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Kleber Souza Sept. 16, 2020, 4:20 p.m. UTC | #1
On 16.09.20 17:32, William Breathitt Gray wrote:
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1894605
> 
> During a dump, this attribute is essential, it enables the userspace to
> know on which interface the context is linked to.
> 
> Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Tested-by: Gabriel Ganne <gabriel.ganne@6wind.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit b274e47d9e3f4dcd4ad4028a316ec22dc4533ac7)
> Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  drivers/net/gtp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index d89ec99abcd6..634bdea38ecb 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
> @@ -1182,6 +1182,7 @@ static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq,
>  		goto nlmsg_failure;
>  
>  	if (nla_put_u32(skb, GTPA_VERSION, pctx->gtp_version) ||
> +	    nla_put_u32(skb, GTPA_LINK, pctx->dev->ifindex) ||
>  	    nla_put_be32(skb, GTPA_PEER_ADDRESS, pctx->peer_addr_ip4.s_addr) ||
>  	    nla_put_be32(skb, GTPA_MS_ADDRESS, pctx->ms_addr_ip4.s_addr))
>  		goto nla_put_failure;
>
Stefan Bader Sept. 17, 2020, 7:36 a.m. UTC | #2
On 16.09.20 17:32, William Breathitt Gray wrote:
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1894605
> 
> During a dump, this attribute is essential, it enables the userspace to
> know on which interface the context is linked to.
> 
> Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Tested-by: Gabriel Ganne <gabriel.ganne@6wind.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit b274e47d9e3f4dcd4ad4028a316ec22dc4533ac7)
> Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/net/gtp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index d89ec99abcd6..634bdea38ecb 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
> @@ -1182,6 +1182,7 @@ static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq,
>  		goto nlmsg_failure;
>  
>  	if (nla_put_u32(skb, GTPA_VERSION, pctx->gtp_version) ||
> +	    nla_put_u32(skb, GTPA_LINK, pctx->dev->ifindex) ||
>  	    nla_put_be32(skb, GTPA_PEER_ADDRESS, pctx->peer_addr_ip4.s_addr) ||
>  	    nla_put_be32(skb, GTPA_MS_ADDRESS, pctx->ms_addr_ip4.s_addr))
>  		goto nla_put_failure;
>
diff mbox series

Patch

diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index d89ec99abcd6..634bdea38ecb 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -1182,6 +1182,7 @@  static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq,
 		goto nlmsg_failure;
 
 	if (nla_put_u32(skb, GTPA_VERSION, pctx->gtp_version) ||
+	    nla_put_u32(skb, GTPA_LINK, pctx->dev->ifindex) ||
 	    nla_put_be32(skb, GTPA_PEER_ADDRESS, pctx->peer_addr_ip4.s_addr) ||
 	    nla_put_be32(skb, GTPA_MS_ADDRESS, pctx->ms_addr_ip4.s_addr))
 		goto nla_put_failure;