l2tp: don't mask errors in pppol2tp_setsockopt()
authorGuillaume Nault <g.nault@alphalink.fr>
Thu, 6 Apr 2017 16:31:20 +0000 (18:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Apr 2017 15:29:04 +0000 (08:29 -0700)
pppol2tp_setsockopt() unconditionally overwrites the error value
returned by pppol2tp_tunnel_setsockopt() or
pppol2tp_session_setsockopt(), thus hiding errors from userspace.

Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ppp.c

index 861b255a2d5195ac4155de919154d993bdaddf92..973a9185b2766816c350b9aaa1c30ad85d396d09 100644 (file)
@@ -1383,8 +1383,6 @@ static int pppol2tp_setsockopt(struct socket *sock, int level, int optname,
        } else
                err = pppol2tp_session_setsockopt(sk, session, optname, val);
 
-       err = 0;
-
 end_put_sess:
        sock_put(sk);
 end: