Commit 3f9b9770 authored by Asbjørn Sloth Tønnesen's avatar Asbjørn Sloth Tønnesen Committed by David S. Miller

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: default avatarAsbjoern Sloth Toennesen <asbjorn@asbjorn.st>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57ceb861
......@@ -715,7 +715,7 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
l2tp_info(session, L2TP_MSG_SEQ,
"%s: requested to enable seq numbers by LNS\n",
session->name);
session->send_seq = -1;
session->send_seq = 1;
l2tp_session_set_header_len(session, tunnel->version);
}
} else {
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment