All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] tipc: failed transmissions should return error
@ 2014-02-19  7:37 erik.hugne
  2014-02-19 21:41 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: erik.hugne @ 2014-02-19  7:37 UTC (permalink / raw)
  To: netdev
  Cc: tipc-discussion, ying.xue, paul.gortmaker, jon.maloy, maloy, Erik Hugne

From: Erik Hugne <erik.hugne@ericsson.com>

When a message could not be sent out because the destination node
or link could not be found, the full message size is returned from
sendmsg() as if it had been sent successfully. An application will
then get a false indication that it's making forward progress. This
problem has existed since the initial commit in 2.6.16.

We change this to return -ENETUNREACH if the message cannot be
delivered due to the destination node/link being unavailable. We
also get rid of the redundant tipc_reject_msg call since freeing
the buffer and doing a tipc_port_iovec_reject accomplishes exactly
the same thing.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
---
v2: Respin on top of 247f0f3c3176c55b46cb9a20011d3d6757634815 
tipc: align tipc function names with common naming practice in the network

 net/tipc/link.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index e4f233d..e998dba 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1020,12 +1020,9 @@ exit:
 	read_unlock_bh(&tipc_net_lock);
 
 	/* Couldn't find a link to the destination node */
-	if (buf)
-		return tipc_reject_msg(buf, TIPC_ERR_NO_NODE);
-	if (res >= 0)
-		return tipc_port_iovec_reject(sender, hdr, msg_sect, len,
-					      TIPC_ERR_NO_NODE);
-	return res;
+	kfree_skb(buf);
+	tipc_port_iovec_reject(sender, hdr, msg_sect, len, TIPC_ERR_NO_NODE);
+	return -ENETUNREACH;
 }
 
 /*
@@ -1163,8 +1160,9 @@ error:
 	} else {
 reject:
 		kfree_skb_list(buf_chain);
-		return tipc_port_iovec_reject(sender, hdr, msg_sect,
-					      len, TIPC_ERR_NO_NODE);
+		tipc_port_iovec_reject(sender, hdr, msg_sect, len,
+				       TIPC_ERR_NO_NODE);
+		return -ENETUNREACH;
 	}
 
 	/* Append chain of fragments to send queue & send them */
-- 
1.7.9.5

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

* Re: [PATCH net-next v2] tipc: failed transmissions should return error
  2014-02-19  7:37 [PATCH net-next v2] tipc: failed transmissions should return error erik.hugne
@ 2014-02-19 21:41 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-02-19 21:41 UTC (permalink / raw)
  To: erik.hugne
  Cc: netdev, tipc-discussion, ying.xue, paul.gortmaker, jon.maloy, maloy

From: <erik.hugne@ericsson.com>
Date: Wed, 19 Feb 2014 08:37:58 +0100

> From: Erik Hugne <erik.hugne@ericsson.com>
> 
> When a message could not be sent out because the destination node
> or link could not be found, the full message size is returned from
> sendmsg() as if it had been sent successfully. An application will
> then get a false indication that it's making forward progress. This
> problem has existed since the initial commit in 2.6.16.
> 
> We change this to return -ENETUNREACH if the message cannot be
> delivered due to the destination node/link being unavailable. We
> also get rid of the redundant tipc_reject_msg call since freeing
> the buffer and doing a tipc_port_iovec_reject accomplishes exactly
> the same thing.
> 
> Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>

Applied, thank you.

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

end of thread, other threads:[~2014-02-19 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-19  7:37 [PATCH net-next v2] tipc: failed transmissions should return error erik.hugne
2014-02-19 21:41 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.