All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] l2tp: fix missing print session offset info
@ 2017-12-21  6:45 Hangbin Liu
  2017-12-21 20:08 ` David Miller
  2017-12-22  3:32 ` [PATCHv2 " Hangbin Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Hangbin Liu @ 2017-12-21  6:45 UTC (permalink / raw)
  To: netdev; +Cc: James Chapman, David S. Miller, Hangbin Liu

Fixes: 309795f4bec ("l2tp: Add netlink control API for L2TP")
Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/l2tp/l2tp_netlink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index a1f24fb..36378b4 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -761,6 +761,8 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl
 
 	if ((session->ifname[0] &&
 	     nla_put_string(skb, L2TP_ATTR_IFNAME, session->ifname)) ||
+	    (session->offset &&
+	     nla_put_u16(skb, L2TP_ATTR_OFFSET, session->offset) ||
 	    (session->cookie_len &&
 	     nla_put(skb, L2TP_ATTR_COOKIE, session->cookie_len,
 		     &session->cookie[0])) ||
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] l2tp: fix missing print session offset info
  2017-12-21  6:45 [PATCH net] l2tp: fix missing print session offset info Hangbin Liu
@ 2017-12-21 20:08 ` David Miller
  2017-12-22  3:29   ` Hangbin Liu
  2017-12-22  3:32 ` [PATCHv2 " Hangbin Liu
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2017-12-21 20:08 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev, jchapman

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Thu, 21 Dec 2017 14:45:30 +0800

> +	    (session->offset &&
> +	     nla_put_u16(skb, L2TP_ATTR_OFFSET, session->offset) ||

It really discourages people from reviewing your changes when they
don't even compile.

net/l2tp/l2tp_netlink.c: In function ‘l2tp_nl_session_send’:
net/l2tp/l2tp_netlink.c:764:23: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
      (session->offset &&
       ~~~~~~~~~~~~~~~~^~
       nla_put_u16(skb, L2TP_ATTR_OFFSET, session->offset) ||
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/l2tp/l2tp_netlink.c:782:3: error: expected ‘)’ before ‘goto’
   goto nla_put_failure;
   ^~~~
 ...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] l2tp: fix missing print session offset info
  2017-12-21 20:08 ` David Miller
@ 2017-12-22  3:29   ` Hangbin Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Hangbin Liu @ 2017-12-22  3:29 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, jchapman

On Thu, Dec 21, 2017 at 03:08:36PM -0500, David Miller wrote:
> From: Hangbin Liu <liuhangbin@gmail.com>
> Date: Thu, 21 Dec 2017 14:45:30 +0800
> 
> > +	    (session->offset &&
> > +	     nla_put_u16(skb, L2TP_ATTR_OFFSET, session->offset) ||
> 
> It really discourages people from reviewing your changes when they
> don't even compile.

Sh*t, I did compile and test my patch on the compiler. But forgot to the fix the
code on my laptop...Really sorry for this, I need to double check it before
send.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCHv2 net] l2tp: fix missing print session offset info
  2017-12-21  6:45 [PATCH net] l2tp: fix missing print session offset info Hangbin Liu
  2017-12-21 20:08 ` David Miller
@ 2017-12-22  3:32 ` Hangbin Liu
  2017-12-22 11:24   ` Lorenzo Bianconi
  1 sibling, 1 reply; 5+ messages in thread
From: Hangbin Liu @ 2017-12-22  3:32 UTC (permalink / raw)
  To: netdev; +Cc: James Chapman, David S. Miller, Hangbin Liu

Fixes: 309795f4bec ("l2tp: Add netlink control API for L2TP")
Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/l2tp/l2tp_netlink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index a1f24fb..36378b4 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -761,6 +761,8 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl
 
 	if ((session->ifname[0] &&
 	     nla_put_string(skb, L2TP_ATTR_IFNAME, session->ifname)) ||
+	    (session->offset &&
+	     nla_put_u16(skb, L2TP_ATTR_OFFSET, session->offset)) ||
 	    (session->cookie_len &&
 	     nla_put(skb, L2TP_ATTR_COOKIE, session->cookie_len,
 		     &session->cookie[0])) ||
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCHv2 net] l2tp: fix missing print session offset info
  2017-12-22  3:32 ` [PATCHv2 " Hangbin Liu
@ 2017-12-22 11:24   ` Lorenzo Bianconi
  0 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2017-12-22 11:24 UTC (permalink / raw)
  To: Hangbin Liu; +Cc: netdev, James Chapman, David S. Miller

> Fixes: 309795f4bec ("l2tp: Add netlink control API for L2TP")
> Reported-by: Jianlin Shi <jishi@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  net/l2tp/l2tp_netlink.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
> index a1f24fb..36378b4 100644
> --- a/net/l2tp/l2tp_netlink.c
> +++ b/net/l2tp/l2tp_netlink.c
> @@ -761,6 +761,8 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl
>
>         if ((session->ifname[0] &&
>              nla_put_string(skb, L2TP_ATTR_IFNAME, session->ifname)) ||
> +           (session->offset &&
> +            nla_put_u16(skb, L2TP_ATTR_OFFSET, session->offset)) ||
>             (session->cookie_len &&
>              nla_put(skb, L2TP_ATTR_COOKIE, session->cookie_len,
>                      &session->cookie[0])) ||
> --
> 2.5.5
>

Hi David,

please hold on a while with this patch, I will send it in a patchset
that addresses some offset related stuff.
Regards,

Lorenzo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-22 11:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21  6:45 [PATCH net] l2tp: fix missing print session offset info Hangbin Liu
2017-12-21 20:08 ` David Miller
2017-12-22  3:29   ` Hangbin Liu
2017-12-22  3:32 ` [PATCHv2 " Hangbin Liu
2017-12-22 11:24   ` Lorenzo Bianconi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.