l2tp: fix missing print session offset info
Subsystems (2)
PATCH 1/1 l2tp: fix missing print session offset info
--- net/l2tp/l2tp_netlink.c | 2 ++ 1 file changed, 2 insertions(+)
net/l2tp/l2tp_netlink.c +2 -0
@@ -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])) ||
Signature · 1 line
2.5.5
David Miller
maintainerFrom: Hangbin Liu <[email protected]>
Date: Thu, 21 Dec 2017 14:45:30 +0800
net/l2tp/l2tp_netlink.c static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl · line 765
Quoted 2 lines
net/l2tp/l2tp_netlink.c +2
-0+ (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;
^~~~
...
Quoted 8 lines · David Miller
From: Hangbin Liu <[email protected]>
Date: Thu, 21 Dec 2017 14:45:30 +0800net/l2tp/l2tp_netlink.c static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl · line 765
Quoted 2 lines
net/l2tp/l2tp_netlink.c +2
-0+ (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.
PATCH v2 1/1 l2tp: fix missing print session offset info
In reply to Hangbin Liu--- net/l2tp/l2tp_netlink.c | 2 ++ 1 file changed, 2 insertions(+)
net/l2tp/l2tp_netlink.c +2 -0
@@ -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])) ||
Signature · 1 line
2.5.5
Quoted 21 lines
Fixes 309795f4bec ("l2tp: Add netlink control API for L2TP")Reported-by Jianlin Shi <[email protected]>Signed-off-by Hangbin Liu <[email protected]>--- net/l2tp/l2tp_netlink.c | 2 ++ 1 file changed, 2 insertions(+)net/l2tp/l2tp_netlink.c +2
-1@@ -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])) || --
Quoted 2 lines
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