]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
l2tp: simplify pppol2tp_ioctl()
authorGuillaume Nault <g.nault@alphalink.fr>
Fri, 10 Aug 2018 11:21:58 +0000 (13:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Aug 2018 19:13:49 +0000 (12:13 -0700)
commitbdd0292f96e43de46283ea0efdef8d13b4ffe895
treee87f71ffc50028abb3743f05e978ffc647c9e39d
parent01e28b921b19cb99a09dda89ab0e5dc49bf4ab38
l2tp: simplify pppol2tp_ioctl()

* Drop test on 'sk': sock->sk cannot be NULL, or pppox_ioctl() could
    not have called us.

  * Drop test on 'SOCK_DEAD' state: if this flag was set, the socket
    would be in the process of being released and no ioctl could be
    running anymore.

  * Drop test on 'PPPOX_*' state: we depend on ->sk_user_data to get
    the session structure. If it is non-NULL, then the socket is
    connected. Testing for PPPOX_* is redundant.

  * Retrieve session using ->sk_user_data directly, instead of going
    through pppol2tp_sock_to_session(). This avoids grabbing a useless
    reference on the socket.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ppp.c