/* If no active link can be found, uses default maximum packet size.  */
u32 tipc_link_get_max_pkt(u32 dest, u32 selector)
/* If no active link can be found, uses default maximum packet size.  */
u32 tipc_link_get_max_pkt(u32 dest, u32 selector)
{
	struct tipc_node *n_ptr;
	struct link *l_ptr;
	u32 res = MAX_PKT_DEFAULT;
	if (dest == tipc_own_addr)
		return MAX_MSG_SIZE;
	read_lock_bh(&tipc_net_lock);
	n_ptr = tipc_node_select(dest, selector);
	if (n_ptr) {
		tipc_node_lock(n_ptr);
		l_ptr = n_ptr->active_links[selector & 1];
		if (l_ptr)
			res = link_max_pkt(l_ptr);
		tipc_node_unlock(n_ptr);
	}
	read_unlock_bh(&tipc_net_lock);
	return res;
}