diff options
Diffstat (limited to 'net/tipc/name_distr.c')
| -rw-r--r-- | net/tipc/name_distr.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 10ff48be3c0..c4583fe888d 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | #include "core.h" | 37 | #include "core.h" |
| 38 | #include "cluster.h" | 38 | #include "addr.h" |
| 39 | #include "link.h" | 39 | #include "link.h" |
| 40 | #include "name_distr.h" | 40 | #include "name_distr.h" |
| 41 | 41 | ||
| @@ -107,6 +107,26 @@ static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest) | |||
| 107 | return buf; | 107 | return buf; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | static void named_cluster_distribute(struct sk_buff *buf) | ||
| 111 | { | ||
| 112 | struct sk_buff *buf_copy; | ||
| 113 | struct tipc_node *n_ptr; | ||
| 114 | u32 n_num; | ||
| 115 | |||
| 116 | for (n_num = 1; n_num <= tipc_net.highest_node; n_num++) { | ||
| 117 | n_ptr = tipc_net.nodes[n_num]; | ||
| 118 | if (n_ptr && tipc_node_has_active_links(n_ptr)) { | ||
| 119 | buf_copy = skb_copy(buf, GFP_ATOMIC); | ||
| 120 | if (!buf_copy) | ||
| 121 | break; | ||
| 122 | msg_set_destnode(buf_msg(buf_copy), n_ptr->addr); | ||
| 123 | tipc_link_send(buf_copy, n_ptr->addr, n_ptr->addr); | ||
| 124 | } | ||
| 125 | } | ||
| 126 | |||
| 127 | buf_discard(buf); | ||
| 128 | } | ||
| 129 | |||
| 110 | /** | 130 | /** |
| 111 | * tipc_named_publish - tell other nodes about a new publication by this node | 131 | * tipc_named_publish - tell other nodes about a new publication by this node |
| 112 | */ | 132 | */ |
| @@ -127,8 +147,8 @@ void tipc_named_publish(struct publication *publ) | |||
| 127 | 147 | ||
| 128 | item = (struct distr_item *)msg_data(buf_msg(buf)); | 148 | item = (struct distr_item *)msg_data(buf_msg(buf)); |
| 129 | publ_to_item(item, publ); | 149 | publ_to_item(item, publ); |
| 130 | dbg("tipc_named_withdraw: broadcasting publish msg\n"); | 150 | dbg("tipc_named_publish: broadcasting publish msg\n"); |
| 131 | tipc_cltr_broadcast(buf); | 151 | named_cluster_distribute(buf); |
| 132 | } | 152 | } |
| 133 | 153 | ||
| 134 | /** | 154 | /** |
| @@ -152,7 +172,7 @@ void tipc_named_withdraw(struct publication *publ) | |||
| 152 | item = (struct distr_item *)msg_data(buf_msg(buf)); | 172 | item = (struct distr_item *)msg_data(buf_msg(buf)); |
| 153 | publ_to_item(item, publ); | 173 | publ_to_item(item, publ); |
| 154 | dbg("tipc_named_withdraw: broadcasting withdraw msg\n"); | 174 | dbg("tipc_named_withdraw: broadcasting withdraw msg\n"); |
| 155 | tipc_cltr_broadcast(buf); | 175 | named_cluster_distribute(buf); |
| 156 | } | 176 | } |
| 157 | 177 | ||
| 158 | /** | 178 | /** |
