mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 13:46:24 +00:00
[PPPoX/E]: return ENOTTY on unknown ioctl requests
here another patch for the PPPoX/E code that makes sure that ENOTTY is returned for unknown ioctl requests rather than 0 (and removes another unneeded initializer which I didn't bother creating a separate patch for). Signed-off-by: Florian Zumbiehl <florz@florz.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c61a7d10ef
commit
86c1dcfc96
2 changed files with 9 additions and 11 deletions
|
@ -664,8 +664,8 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
|
||||||
{
|
{
|
||||||
struct sock *sk = sock->sk;
|
struct sock *sk = sock->sk;
|
||||||
struct pppox_sock *po = pppox_sk(sk);
|
struct pppox_sock *po = pppox_sk(sk);
|
||||||
int val = 0;
|
int val;
|
||||||
int err = 0;
|
int err;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case PPPIOCGMRU:
|
case PPPIOCGMRU:
|
||||||
|
@ -754,8 +754,9 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
|
||||||
err = 0;
|
err = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:;
|
default:
|
||||||
};
|
err = -ENOTTY;
|
||||||
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct sock *sk = sock->sk;
|
struct sock *sk = sock->sk;
|
||||||
struct pppox_sock *po = pppox_sk(sk);
|
struct pppox_sock *po = pppox_sk(sk);
|
||||||
int rc = 0;
|
int rc;
|
||||||
|
|
||||||
lock_sock(sk);
|
lock_sock(sk);
|
||||||
|
|
||||||
|
@ -94,12 +94,9 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if (pppox_protos[sk->sk_protocol]->ioctl)
|
rc = pppox_protos[sk->sk_protocol]->ioctl ?
|
||||||
rc = pppox_protos[sk->sk_protocol]->ioctl(sock, cmd,
|
pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : -ENOTTY;
|
||||||
arg);
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
|
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in a new issue