netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v1 1/1] tipc: use only positive error codes in messages
@ 2017-09-29  8:02 Parthasarathy Bhuvaragan
  2017-10-01  3:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Parthasarathy Bhuvaragan @ 2017-09-29  8:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, tipc-discussion, jon.maloy, maloy, ying.xue,
	parthasarathy.bhuvaragan

In commit e3a77561e7d32 ("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: e3a77561e7d32 ("tipc: split up function tipc_msg_eval()")
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
---
 net/tipc/msg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 6ef379f004ac..121e59a1d0e7 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -551,7 +551,7 @@ bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, int *err)
 		return false;
 	if (msg_errcode(msg))
 		return false;
-	*err = -TIPC_ERR_NO_NAME;
+	*err = TIPC_ERR_NO_NAME;
 	if (skb_linearize(skb))
 		return false;
 	msg = buf_msg(skb);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v1 1/1] tipc: use only positive error codes in messages
  2017-09-29  8:02 [PATCH net v1 1/1] tipc: use only positive error codes in messages Parthasarathy Bhuvaragan
@ 2017-10-01  3:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-10-01  3:04 UTC (permalink / raw)
  To: parthasarathy.bhuvaragan
  Cc: netdev, tipc-discussion, jon.maloy, maloy, ying.xue,
	parthasarathy.bhuvaragan

From: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Date: Fri, 29 Sep 2017 10:02:54 +0200

> In commit e3a77561e7d32 ("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: e3a77561e7d32 ("tipc: split up function tipc_msg_eval()")
> Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-01  3:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-29  8:02 [PATCH net v1 1/1] tipc: use only positive error codes in messages Parthasarathy Bhuvaragan
2017-10-01  3:04 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).