tipc: send explicit not supported error in nl compat
authorRichard Alpe <richard.alpe@ericsson.com>
Wed, 6 May 2015 11:58:56 +0000 (13:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 May 2015 20:40:03 +0000 (16:40 -0400)
The legacy netlink API treated EPERM (permission denied) as
"operation not supported".

Reported-by: Tomi Ollila <tomi.ollila@iki.fi>
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/netlink_compat.c

index 809aaf027876b995e7e6d8db3c645b0a7f4bda8b..53e0fee800864e4b8c29ed793d60a5823d59c773 100644 (file)
@@ -1121,7 +1121,7 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, struct genl_info *info)
        }
 
        err = tipc_nl_compat_handle(&msg);
-       if (err == -EOPNOTSUPP)
+       if ((err == -EOPNOTSUPP) || (err == -EPERM))
                msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED);
        else if (err == -EINVAL)
                msg.rep = tipc_get_err_tlv(TIPC_CFG_TLV_ERROR);