Skip to content

Commit

Permalink
tipc: send explicit not supported error in nl compat
Browse files Browse the repository at this point in the history
The legacy netlink API treated EPERM (permission denied) as
"operation not supported".

Reported-by: Tomi Ollila <[email protected]>
Signed-off-by: Richard Alpe <[email protected]>
Reviewed-by: Erik Hugne <[email protected]>
Reviewed-by: Ying Xue <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Richard Alpe authored and davem330 committed May 9, 2015
1 parent 670f4f8 commit b063bc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/tipc/netlink_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b063bc5

Please sign in to comment.