Message ID | 20121128080804.GA23175@shrek.podlesie.net |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
On Wed, 2012-11-28 at 09:08 +0100, Krzysztof Mazur wrote: > > I think you might need also an equivalent of > "[PATCH v3 3/7] pppoatm: allow assign only on a connected socket". > > I'm not sure yet. In will test if I can trigger that Oops on pppoatm > without that patch. Testing vcc flags might be sufficient - that's > what I did in the first patch, but you asked what about SOCK_CONNECTED, > and I think it was really needed. Even if the READY check avoids the oops, I think the patch makes sense. Especially as it makes things consistent with pppoatm. I've applied it to the tree. Thanks.
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 59e8edb..e88998c 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c @@ -704,10 +704,13 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd, return -ENOIOCTLCMD; if (!capable(CAP_NET_ADMIN)) return -EPERM; - if (cmd == ATM_SETBACKEND) + if (cmd == ATM_SETBACKEND) { + if (sock->state != SS_CONNECTED) + return -EINVAL; return br2684_regvcc(atmvcc, argp); - else + } else { return br2684_create(argp); + } #ifdef CONFIG_ATM_BR2684_IPFILTER case BR2684_SETFILT: if (atmvcc->push != br2684_push)