diff options
author | Asbjørn Sloth Tønnesen <asbjorn@asbjorn.st> | 2016-11-07 21:39:28 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-10 00:55:36 +0100 |
commit | 3f9b9770b479986cb6acebaf8372f15c0cbd7f85 (patch) | |
tree | ab05bb2f30b6a99ff0325f4563838a63e75fd855 /net/l2tp/l2tp_ppp.c | |
parent | net: l2tp: cleanup: remove redundant condition (diff) | |
download | linux-3f9b9770b479986cb6acebaf8372f15c0cbd7f85.tar.xz linux-3f9b9770b479986cb6acebaf8372f15c0cbd7f85.zip |
net: l2tp: fix negative assignment to unsigned int
recv_seq, send_seq and lns_mode mode are all defined as
unsigned int foo:1;
Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.st>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp/l2tp_ppp.c')
-rw-r--r-- | net/l2tp/l2tp_ppp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index 41d47bfda15c..2ddfec1e4acf 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c @@ -1272,7 +1272,7 @@ static int pppol2tp_session_setsockopt(struct sock *sk, err = -EINVAL; break; } - session->recv_seq = val ? -1 : 0; + session->recv_seq = !!val; l2tp_info(session, PPPOL2TP_MSG_CONTROL, "%s: set recv_seq=%d\n", session->name, session->recv_seq); @@ -1283,7 +1283,7 @@ static int pppol2tp_session_setsockopt(struct sock *sk, err = -EINVAL; break; } - session->send_seq = val ? -1 : 0; + session->send_seq = !!val; { struct sock *ssk = ps->sock; struct pppox_sock *po = pppox_sk(ssk); @@ -1301,7 +1301,7 @@ static int pppol2tp_session_setsockopt(struct sock *sk, err = -EINVAL; break; } - session->lns_mode = val ? -1 : 0; + session->lns_mode = !!val; l2tp_info(session, PPPOL2TP_MSG_CONTROL, "%s: set lns_mode=%d\n", session->name, session->lns_mode); |