Skip to content

Commit

Permalink
tipc: Add check to prevent insertion of duplicate name table entries
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Feb 24, 2012
1 parent c422f1b commit f80c24d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/tipc/name_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ static struct publication *tipc_nameseq_insert_publ(struct name_seq *nseq,
}

info = sseq->info;

/* Check if an identical publication already exists */
list_for_each_entry(publ, &info->zone_list, zone_list) {
if ((publ->ref == port) && (publ->key == key) &&
(!publ->node || (publ->node == node)))
return NULL;
}
} else {
u32 inspos;
struct sub_seq *freesseq;
Expand Down

0 comments on commit f80c24d

Please sign in to comment.