Blob Blame History Raw
From: Hoang Le <hoang.h.le@dektech.com.au>
Date: Tue, 9 Apr 2019 14:59:24 +0700
Subject: tipc: missing entries in name table of publications
Git-commit: d1841533e54876f152a30ac398a34f47ad6590b1
Patch-mainline: v5.1-rc6
References: networking-stable-19_04_19

When binding multiple services with specific type 1Ki, 2Ki..,
this leads to some entries in the name table of publications
missing when listed out via 'tipc name show'.

The problem is at identify zero last_type conditional provided
via netlink. The first is initial 'type' when starting name table
dummping. The second is continuously with zero type (node state
service type). Then, lookup function failure to finding node state
service type in next iteration.

To solve this, adding more conditional to marked as dirty type and
lookup correct service type for the next iteration instead of select
the first service as initial 'type' zero.

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 net/tipc/name_table.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -989,7 +989,8 @@ static int tipc_nl_seq_list(struct net *
 	for (; i < TIPC_NAMETBL_SIZE; i++) {
 		seq_head = &tn->nametbl->seq_hlist[i];
 
-		if (*last_type) {
+		if (*last_type ||
+		    (!i && *last_publ && (*last_lower == *last_publ))) {
 			seq = nametbl_find_seq(net, *last_type);
 			if (!seq)
 				return -EPIPE;