diff options
Diffstat (limited to 'net/tipc/name_table.c')
-rw-r--r-- | net/tipc/name_table.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index 91fce70291a8..e190460fe0d3 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -47,12 +47,6 @@ | |||
47 | 47 | ||
48 | #define TIPC_NAMETBL_SIZE 1024 /* must be a power of 2 */ | 48 | #define TIPC_NAMETBL_SIZE 1024 /* must be a power of 2 */ |
49 | 49 | ||
50 | static const struct nla_policy | ||
51 | tipc_nl_name_table_policy[TIPC_NLA_NAME_TABLE_MAX + 1] = { | ||
52 | [TIPC_NLA_NAME_TABLE_UNSPEC] = { .type = NLA_UNSPEC }, | ||
53 | [TIPC_NLA_NAME_TABLE_PUBL] = { .type = NLA_NESTED } | ||
54 | }; | ||
55 | |||
56 | /** | 50 | /** |
57 | * struct name_info - name sequence publication info | 51 | * struct name_info - name sequence publication info |
58 | * @node_list: circular list of publications made by own node | 52 | * @node_list: circular list of publications made by own node |
@@ -418,6 +412,9 @@ static void tipc_nameseq_subscribe(struct name_seq *nseq, | |||
418 | struct tipc_subscription *s) | 412 | struct tipc_subscription *s) |
419 | { | 413 | { |
420 | struct sub_seq *sseq = nseq->sseqs; | 414 | struct sub_seq *sseq = nseq->sseqs; |
415 | struct tipc_name_seq ns; | ||
416 | |||
417 | tipc_subscrp_convert_seq(&s->evt.s.seq, s->swap, &ns); | ||
421 | 418 | ||
422 | list_add(&s->nameseq_list, &nseq->subscriptions); | 419 | list_add(&s->nameseq_list, &nseq->subscriptions); |
423 | 420 | ||
@@ -425,7 +422,7 @@ static void tipc_nameseq_subscribe(struct name_seq *nseq, | |||
425 | return; | 422 | return; |
426 | 423 | ||
427 | while (sseq != &nseq->sseqs[nseq->first_free]) { | 424 | while (sseq != &nseq->sseqs[nseq->first_free]) { |
428 | if (tipc_subscrp_check_overlap(s, sseq->lower, sseq->upper)) { | 425 | if (tipc_subscrp_check_overlap(&ns, sseq->lower, sseq->upper)) { |
429 | struct publication *crs; | 426 | struct publication *crs; |
430 | struct name_info *info = sseq->info; | 427 | struct name_info *info = sseq->info; |
431 | int must_report = 1; | 428 | int must_report = 1; |
@@ -722,9 +719,10 @@ int tipc_nametbl_withdraw(struct net *net, u32 type, u32 lower, u32 ref, | |||
722 | void tipc_nametbl_subscribe(struct tipc_subscription *s) | 719 | void tipc_nametbl_subscribe(struct tipc_subscription *s) |
723 | { | 720 | { |
724 | struct tipc_net *tn = net_generic(s->net, tipc_net_id); | 721 | struct tipc_net *tn = net_generic(s->net, tipc_net_id); |
725 | u32 type = s->seq.type; | 722 | u32 type = tipc_subscrp_convert_seq_type(s->evt.s.seq.type, s->swap); |
726 | int index = hash(type); | 723 | int index = hash(type); |
727 | struct name_seq *seq; | 724 | struct name_seq *seq; |
725 | struct tipc_name_seq ns; | ||
728 | 726 | ||
729 | spin_lock_bh(&tn->nametbl_lock); | 727 | spin_lock_bh(&tn->nametbl_lock); |
730 | seq = nametbl_find_seq(s->net, type); | 728 | seq = nametbl_find_seq(s->net, type); |
@@ -735,8 +733,9 @@ void tipc_nametbl_subscribe(struct tipc_subscription *s) | |||
735 | tipc_nameseq_subscribe(seq, s); | 733 | tipc_nameseq_subscribe(seq, s); |
736 | spin_unlock_bh(&seq->lock); | 734 | spin_unlock_bh(&seq->lock); |
737 | } else { | 735 | } else { |
736 | tipc_subscrp_convert_seq(&s->evt.s.seq, s->swap, &ns); | ||
738 | pr_warn("Failed to create subscription for {%u,%u,%u}\n", | 737 | pr_warn("Failed to create subscription for {%u,%u,%u}\n", |
739 | s->seq.type, s->seq.lower, s->seq.upper); | 738 | ns.type, ns.lower, ns.upper); |
740 | } | 739 | } |
741 | spin_unlock_bh(&tn->nametbl_lock); | 740 | spin_unlock_bh(&tn->nametbl_lock); |
742 | } | 741 | } |
@@ -748,9 +747,10 @@ void tipc_nametbl_unsubscribe(struct tipc_subscription *s) | |||
748 | { | 747 | { |
749 | struct tipc_net *tn = net_generic(s->net, tipc_net_id); | 748 | struct tipc_net *tn = net_generic(s->net, tipc_net_id); |
750 | struct name_seq *seq; | 749 | struct name_seq *seq; |
750 | u32 type = tipc_subscrp_convert_seq_type(s->evt.s.seq.type, s->swap); | ||
751 | 751 | ||
752 | spin_lock_bh(&tn->nametbl_lock); | 752 | spin_lock_bh(&tn->nametbl_lock); |
753 | seq = nametbl_find_seq(s->net, s->seq.type); | 753 | seq = nametbl_find_seq(s->net, type); |
754 | if (seq != NULL) { | 754 | if (seq != NULL) { |
755 | spin_lock_bh(&seq->lock); | 755 | spin_lock_bh(&seq->lock); |
756 | list_del_init(&s->nameseq_list); | 756 | list_del_init(&s->nameseq_list); |