Commit 8a55fe74 authored by Allan Stephens's avatar Allan Stephens Committed by Paul Gortmaker

tipc: handle <0.0.0> as an alias for this node on outgoing msgs

Revises handling of send routines for payload messages to ensure that
they are processed properly even if the node's network address is
changed in mid-operation. The routines now treat the default node
address of <0.0.0> as an alias for "this node" when determining where
to send an outgoing message.
Signed-off-by: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent b8f683d1
...@@ -1217,7 +1217,7 @@ int tipc_send(u32 ref, unsigned int num_sect, struct iovec const *msg_sect, ...@@ -1217,7 +1217,7 @@ int tipc_send(u32 ref, unsigned int num_sect, struct iovec const *msg_sect,
p_ptr->congested = 1; p_ptr->congested = 1;
if (!tipc_port_congested(p_ptr)) { if (!tipc_port_congested(p_ptr)) {
destnode = port_peernode(p_ptr); destnode = port_peernode(p_ptr);
if (likely(destnode != tipc_own_addr)) if (likely(!in_own_node(destnode)))
res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect, res = tipc_link_send_sections_fast(p_ptr, msg_sect, num_sect,
total_len, destnode); total_len, destnode);
else else
...@@ -1267,7 +1267,7 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain, ...@@ -1267,7 +1267,7 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain,
msg_set_destport(msg, destport); msg_set_destport(msg, destport);
if (likely(destport || destnode)) { if (likely(destport || destnode)) {
if (likely(destnode == tipc_own_addr)) if (likely(in_own_node(destnode)))
res = tipc_port_recv_sections(p_ptr, num_sect, res = tipc_port_recv_sections(p_ptr, num_sect,
msg_sect, total_len); msg_sect, total_len);
else if (tipc_own_addr) else if (tipc_own_addr)
...@@ -1315,7 +1315,7 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest, ...@@ -1315,7 +1315,7 @@ int tipc_send2port(u32 ref, struct tipc_portid const *dest,
msg_set_destport(msg, dest->ref); msg_set_destport(msg, dest->ref);
msg_set_hdr_sz(msg, BASIC_H_SIZE); msg_set_hdr_sz(msg, BASIC_H_SIZE);
if (dest->node == tipc_own_addr) if (in_own_node(dest->node))
res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect, res = tipc_port_recv_sections(p_ptr, num_sect, msg_sect,
total_len); total_len);
else if (tipc_own_addr) else if (tipc_own_addr)
...@@ -1362,7 +1362,7 @@ int tipc_send_buf2port(u32 ref, struct tipc_portid const *dest, ...@@ -1362,7 +1362,7 @@ int tipc_send_buf2port(u32 ref, struct tipc_portid const *dest,
skb_push(buf, BASIC_H_SIZE); skb_push(buf, BASIC_H_SIZE);
skb_copy_to_linear_data(buf, msg, BASIC_H_SIZE); skb_copy_to_linear_data(buf, msg, BASIC_H_SIZE);
if (dest->node == tipc_own_addr) if (in_own_node(dest->node))
res = tipc_port_recv_msg(buf); res = tipc_port_recv_msg(buf);
else else
res = tipc_send_buf_fast(buf, dest->node); res = tipc_send_buf_fast(buf, dest->node);
......
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