diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2006-06-25 23:51:37 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-25 23:51:37 -0700 |
commit | f131072c3da84e70a0f65d71b3a3f6611c6a22bc (patch) | |
tree | 6b00e151ee25a9d20fc56c4aa5f947561a65047d /net/tipc/link.c | |
parent | e100ae92a68c55e7ba287866c20fe1b0ad4fcdee (diff) |
[TIPC]: First phase of assert() cleanup
This also contains enhancements to simplify comparisons in name table
publication removal algorithm and to simplify name table sanity checking
when shutting down TIPC.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index ff40c9195fe..2efced5a673 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -574,7 +574,6 @@ void tipc_link_wakeup_ports(struct link *l_ptr, int all) break; list_del_init(&p_ptr->wait_list); p_ptr->congested_link = NULL; - assert(p_ptr->wakeup); spin_lock_bh(p_ptr->publ.lock); p_ptr->publ.congested = 0; p_ptr->wakeup(&p_ptr->publ); @@ -1246,8 +1245,6 @@ int tipc_link_send_sections_fast(struct port *sender, int res; u32 selector = msg_origport(hdr) & 1; - assert(destaddr != tipc_own_addr); - again: /* * Try building message using port's max_pkt hint. @@ -2310,7 +2307,6 @@ void tipc_link_tunnel(struct link *l_ptr, memcpy(buf->data + INT_H_SIZE, (unchar *)msg, length); dbg("%c->%c:", l_ptr->b_ptr->net_plane, tunnel->b_ptr->net_plane); msg_dbg(buf_msg(buf), ">SEND>"); - assert(tunnel); tipc_link_send_buf(tunnel, buf); } @@ -2339,10 +2335,10 @@ void tipc_link_changeover(struct link *l_ptr) ORIGINAL_MSG, TIPC_OK, INT_H_SIZE, l_ptr->addr); msg_set_bearer_id(&tunnel_hdr, l_ptr->peer_bearer_id); msg_set_msgcnt(&tunnel_hdr, msgcount); + if (!l_ptr->first_out) { struct sk_buff *buf; - assert(!msgcount); buf = buf_acquire(INT_H_SIZE); if (buf) { memcpy(buf->data, (unchar *)&tunnel_hdr, INT_H_SIZE); @@ -2356,6 +2352,7 @@ void tipc_link_changeover(struct link *l_ptr) } return; } + while (crs) { struct tipc_msg *msg = buf_msg(crs); @@ -2455,11 +2452,15 @@ static int link_recv_changeover_msg(struct link **l_ptr, u32 msg_count = msg_msgcnt(tunnel_msg); dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)]; - assert(dest_link != *l_ptr); if (!dest_link) { msg_dbg(tunnel_msg, "NOLINK/<REC<"); goto exit; } + if (dest_link == *l_ptr) { + err("Unexpected changeover message on link <%s>\n", + (*l_ptr)->name); + goto exit; + } dbg("%c<-%c:", dest_link->b_ptr->net_plane, (*l_ptr)->b_ptr->net_plane); *l_ptr = dest_link; |