• Guillaume Nault's avatar
    l2tp: simplify pppol2tp_ioctl() · bdd0292f
    Guillaume Nault authored
    * 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: default avatarGuillaume Nault <g.nault@alphalink.fr>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    bdd0292f
l2tp_ppp.c 45.1 KB