Commit 625631d9 authored by Parthasarathy Bhuvaragan's avatar Parthasarathy Bhuvaragan Committed by Thadeu Lima de Souza Cascardo

tipc: use only positive error codes in messages

BugLink: http://bugs.launchpad.net/bugs/1729105


[ Upstream commit aad06212 ]

In commit e3a77561 ("tipc: split up function tipc_msg_eval()"),
we have updated the function tipc_msg_lookup_dest() to set the error
codes to negative values at destination lookup failures. Thus when
the function sets the error code to -TIPC_ERR_NO_NAME, its inserted
into the 4 bit error field of the message header as 0xf instead of
TIPC_ERR_NO_NAME (1). The value 0xf is an unknown error code.

In this commit, we set only positive error code.

Fixes: e3a77561 ("tipc: split up function tipc_msg_eval()")
Signed-off-by: default avatarParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8067b04a
...@@ -541,7 +541,7 @@ bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, int *err) ...@@ -541,7 +541,7 @@ bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, int *err)
return false; return false;
if (msg_errcode(msg)) if (msg_errcode(msg))
return false; return false;
*err = -TIPC_ERR_NO_NAME; *err = TIPC_ERR_NO_NAME;
if (skb_linearize(skb)) if (skb_linearize(skb))
return false; return false;
msg = buf_msg(skb); msg = buf_msg(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment