summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2012-04-18 09:22:56 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-04-19 15:46:47 -0400
commitb8f683d126c1cb757e794d6d904cbe7cf5954797 (patch)
tree70206c678cb16bf0b7e6e32ea8a6a18111c41b03 /net/tipc
parent974a5a864bf959b7f3412a31ee8ce001c6628451 (diff)
downloadlinux-3.10-b8f683d126c1cb757e794d6d904cbe7cf5954797.tar.gz
linux-3.10-b8f683d126c1cb757e794d6d904cbe7cf5954797.tar.bz2
linux-3.10-b8f683d126c1cb757e794d6d904cbe7cf5954797.zip
tipc: properly handle off-node send requests with invalid addr
There are two send routines that might conceivably be asked by an application to send a message off-node when the node is still using the default network address. These now have an added check that detects this and rejects the message gracefully. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/port.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 616c72fb923..dc7f916b2e1 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -1270,10 +1270,14 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
if (likely(destnode == tipc_own_addr))
res = tipc_port_recv_sections(p_ptr, num_sect,
msg_sect, total_len);
- else
+ else if (tipc_own_addr)
res = tipc_link_send_sections_fast(p_ptr, msg_sect,
num_sect, total_len,
destnode);
+ else
+ res = tipc_port_reject_sections(p_ptr, msg, msg_sect,
+ num_sect, total_len,
+ TIPC_ERR_NO_NODE);
if (likely(res != -ELINKCONG)) {
if (res > 0)
p_ptr->sent++;
@@ -1314,9 +1318,12 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest,
if (dest->node == tipc_own_addr)
res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect,
total_len);
- else
+ else if (tipc_own_addr)
res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect,
total_len, dest->node);
+ else
+ res = tipc_port_reject_sections(p_ptr, msg, msg_sect, num_sect,
+ total_len, TIPC_ERR_NO_NODE);
if (likely(res != -ELINKCONG)) {
if (res > 0)
p_ptr->sent++;