aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-11-03 11:12:01 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-02-24 17:05:14 -0500
commitf80c24d9964c8a15c55d1afc2dea327c5eff7d6b (patch)
tree8a174990875cf1e7bfc8e0dff2272d5488bd7807 /net/tipc
parentc422f1bdc3d3f9f637b3d288a6601668e26111d6 (diff)
tipc: Add check to prevent insertion of duplicate name table entries
Adds a new check to TIPC's name table logic to reject any attempt to create a new name publication that is identical to an existing one. (Such an attempt will never happen under normal circumstances, but could arise if another network node malfunctions and issues a duplicate name publication message.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/name_table.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 1196f050e334..c2224f98e64f 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -268,6 +268,13 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
268 } 268 }
269 269
270 info = sseq->info; 270 info = sseq->info;
271
272 /* Check if an identical publication already exists */
273 list_for_each_entry(publ, &info->zone_list, zone_list) {
274 if ((publ->ref == port) && (publ->key == key) &&
275 (!publ->node || (publ->node == node)))
276 return NULL;
277 }
271 } else { 278 } else {
272 u32 inspos; 279 u32 inspos;
273 struct sub_seq *freesseq; 280 struct sub_seq *freesseq;