aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2014-02-19 02:37:58 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-19 16:40:57 -0500
commit63fa01c147b98eaf5e5e4620c3c7bea8e9ddbbc1 (patch)
tree1ccb3537b09f42c0fffe9542ffb693c7bd1f75e8 /net/tipc
parent5f4d4e3f1cfe97b1d7d696e2608c41c2ad123cfc (diff)
tipc: failed transmissions should return error
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/link.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 284d6383ad6c..d1a764b9b2d8 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1020,12 +1020,9 @@ exit:
1020 read_unlock_bh(&tipc_net_lock); 1020 read_unlock_bh(&tipc_net_lock);
1021 1021
1022 /* Couldn't find a link to the destination node */ 1022 /* Couldn't find a link to the destination node */
1023 if (buf) 1023 kfree_skb(buf);
1024 return tipc_reject_msg(buf, TIPC_ERR_NO_NODE); 1024 tipc_port_iovec_reject(sender, hdr, msg_sect, len, TIPC_ERR_NO_NODE);
1025 if (res >= 0) 1025 return -ENETUNREACH;
1026 return tipc_port_iovec_reject(sender, hdr, msg_sect, len,
1027 TIPC_ERR_NO_NODE);
1028 return res;
1029} 1026}
1030 1027
1031/* 1028/*
@@ -1163,8 +1160,9 @@ error:
1163 } else { 1160 } else {
1164reject: 1161reject:
1165 kfree_skb_list(buf_chain); 1162 kfree_skb_list(buf_chain);
1166 return tipc_port_iovec_reject(sender, hdr, msg_sect, 1163 tipc_port_iovec_reject(sender, hdr, msg_sect, len,
1167 len, TIPC_ERR_NO_NODE); 1164 TIPC_ERR_NO_NODE);
1165 return -ENETUNREACH;
1168 } 1166 }
1169 1167
1170 /* Append chain of fragments to send queue & send them */ 1168 /* Append chain of fragments to send queue & send them */