diff options
author | Krzysztof Mazur <krzysiek@podlesie.net> | 2012-11-06 17:16:58 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-11-27 19:37:02 -0500 |
commit | 3b1a914595f3f9beb9e38ff3ddc7bdafa092ba22 (patch) | |
tree | 03acc4ae1063017d6986d149cd4ffe5140f3e63c /net/atm | |
parent | ec809bd817dfa1905283468e4c813684ed4efe78 (diff) |
pppoatm: allow assign only on a connected socket
The pppoatm does not check if used vcc is in connected state,
causing an Oops in pppoatm_send() when vcc->send() is called
on not fully connected socket.
Now pppoatm can be assigned only on connected sockets; otherwise
-EINVAL error is returned.
Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
Cc: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/pppoatm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index 226dca989448..f27a07a3c546 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c | |||
@@ -406,6 +406,8 @@ static int pppoatm_ioctl(struct socket *sock, unsigned int cmd, | |||
406 | return -ENOIOCTLCMD; | 406 | return -ENOIOCTLCMD; |
407 | if (!capable(CAP_NET_ADMIN)) | 407 | if (!capable(CAP_NET_ADMIN)) |
408 | return -EPERM; | 408 | return -EPERM; |
409 | if (sock->state != SS_CONNECTED) | ||
410 | return -EINVAL; | ||
409 | return pppoatm_assign_vcc(atmvcc, argp); | 411 | return pppoatm_assign_vcc(atmvcc, argp); |
410 | } | 412 | } |
411 | case PPPIOCGCHAN: | 413 | case PPPIOCGCHAN: |