l2tp: fix missing print session offset info
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 22 Dec 2017 14:10:17 +0000 (15:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Dec 2017 17:11:51 +0000 (12:11 -0500)
Report offset parameter in L2TP_CMD_SESSION_GET command if
it has been configured by userspace

Fixes: 309795f4bec ("l2tp: Add netlink control API for L2TP")
Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_netlink.c

index a1f24fb2be980b204f83de977c452f3027d1cfa8..7e9c5012555627acb88f2263ee4c07fa83560da9 100644 (file)
@@ -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])) ||