[NETFILTER]: Fix ip6tables breakage from {get,set}sockopt compat layer

do_ipv6_getsockopt returns -EINVAL for unknown options, not
-ENOPROTOOPT as do_ipv6_setsockopt.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Patrick McHardy 2006-03-22 13:53:20 -08:00 committed by David S. Miller
parent 1c2e02750b
commit 443da0d527

View file

@ -907,7 +907,7 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
#ifdef CONFIG_NETFILTER
/* we need to exclude all possible EINVALs except default case */
if (err == -ENOPROTOOPT && optname != IPV6_ADDRFORM &&
if (err == -EINVAL && optname != IPV6_ADDRFORM &&
optname != MCAST_MSFILTER) {
int len;
@ -944,7 +944,7 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
#ifdef CONFIG_NETFILTER
/* we need to exclude all possible EINVALs except default case */
if (err == -ENOPROTOOPT && optname != IPV6_ADDRFORM &&
if (err == -EINVAL && optname != IPV6_ADDRFORM &&
optname != MCAST_MSFILTER) {
int len;