aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/name_distr.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index cd356e504332..21bc0281ec89 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -175,16 +175,32 @@ void tipc_named_withdraw(struct publication *publ)
175 175
176void tipc_named_node_up(unsigned long node) 176void tipc_named_node_up(unsigned long node)
177{ 177{
178 struct tipc_node *n_ptr;
179 struct link *l_ptr;
178 struct publication *publ; 180 struct publication *publ;
179 struct distr_item *item = NULL; 181 struct distr_item *item = NULL;
180 struct sk_buff *buf = NULL; 182 struct sk_buff *buf = NULL;
181 u32 left = 0; 183 u32 left = 0;
182 u32 rest; 184 u32 rest;
183 u32 max_item_buf; 185 u32 max_item_buf = 0;
186
187 /* compute maximum amount of publication data to send per message */
188
189 read_lock_bh(&tipc_net_lock);
190 n_ptr = tipc_node_find((u32)node);
191 if (n_ptr) {
192 tipc_node_lock(n_ptr);
193 l_ptr = n_ptr->active_links[0];
194 if (l_ptr)
195 max_item_buf = ((l_ptr->max_pkt - INT_H_SIZE) /
196 ITEM_SIZE) * ITEM_SIZE;
197 tipc_node_unlock(n_ptr);
198 }
199 read_unlock_bh(&tipc_net_lock);
200 if (!max_item_buf)
201 return;
184 202
185 read_lock_bh(&tipc_nametbl_lock); 203 read_lock_bh(&tipc_nametbl_lock);
186 max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE;
187 max_item_buf *= ITEM_SIZE;
188 rest = publ_cnt * ITEM_SIZE; 204 rest = publ_cnt * ITEM_SIZE;
189 205
190 list_for_each_entry(publ, &publ_root, local_list) { 206 list_for_each_entry(publ, &publ_root, local_list) {