[tipc-discussion] [net-next 04/16] tipc: simplify signature of tipc_namtbl_publish()

2020-12-08 Thread jmaloy
From: Jon Maloy Using the new address structure tipc_uaddr, we simplify the signature of function tipc_sk_publish() and tipc_namtbl_publish() so that fewer parameters need to be passed around. Signed-off-by: Jon Maloy --- net/tipc/name_table.c | 10 +++--- net/tipc/name_table.h | 6 ++--

[tipc-discussion] [net-next 10/16] tipc: simplify signature of tipc_nametbl_lookup_mcast_nodes()

2020-12-08 Thread jmaloy
From: Jon Maloy We follow up the preceding commits by reducing the signature of the function tipc_nametbl_lookup_mcast_nodes(). Signed-off-by: Jon Maloy --- net/tipc/name_table.c | 8 net/tipc/name_table.h | 4 ++-- net/tipc/socket.c | 16 +++- 3 files changed, 13

[tipc-discussion] [net-next 03/16] tipc: introduce new unified address type for internal use

2020-12-08 Thread jmaloy
From: Jon Maloy We introduce a simplified version of struct sockaddr_tipc, using anonymous unions and structures. Apart from being nicer to work with, this struct will come in handy when we in a later commit add another address type. Signed-off-by: Jon Maloy --- net/tipc/addr.h | 44

[tipc-discussion] [net-next 00/16] tipc: cleanups and simplifications

2020-12-08 Thread jmaloy
From: Jon Maloy We make a number of simplifications and cleanups, especially to call signatures in the binding table. This makes the code easier to understand and serves as a preparation for an upcoming functional addition. Jon Maloy (16): tipc: re-organize members of struct publication

[tipc-discussion] [net-next 08/16] tipc: refactor tipc_sendmsg() and tipc_lookup_anycast()

2020-12-08 Thread jmaloy
From: Jon Maloy We simplify the signature if function tipc_nametbl_lookup_anycast(), using address structures instead of dicrete integers. This also makes it possible to make some improvements to the functions __tipc_sendmsg() in socket.c and tipc_msg_lookup_dest() in msg.c. Signed-off-by: Jon

[tipc-discussion] [net-next 07/16] tipc: rename binding table lookup functions

2020-12-08 Thread jmaloy
From: Jon Maloy The binding table provides four different lookup functions, which purpose is not obvious neither by their names nor by the (lack of) descriptions. We now give these functions that match their purpose, and add comments that further describe what they are doing. Signed-off-by:

[tipc-discussion] [net-next 16/16] tipc: remove some unnecessary warnings

2020-12-08 Thread jmaloy
From: Jon Maloy We move some warning printouts to more strategic locations to avoid duplicates and yield more detailed information about the reported problem. Signed-off-by: Jon Maloy --- net/tipc/name_distr.c | 7 --- net/tipc/name_table.c | 36 +--- 2

[tipc-discussion] [net-next 14/16] tipc: simplify api between binding table and topology server

2020-12-08 Thread jmaloy
From: Jon Maloy The function tipc_report_overlap() is called from the binding table with numerous parameters taken from an instance of struct publication. A closer look reveals that it always is safe to send along a pointer to the instance itself, and hence reduce the call signature. We do that

[tipc-discussion] [net-next 02/16] tipc: move creation of publication item one level up in call chain

2020-12-08 Thread jmaloy
From: Jon Maloy We instantiante struct publication in tipc_nametbl_insert_publ() instead of as currently in tipc_service_insert_publ(). This has the advantage that we can pass a pointer to the publication struct to the next call levels, instead of the numerous individual parameters we pass on

[tipc-discussion] [net-next 05/16] tipc: simplify call signatures for publication creation

2020-12-08 Thread jmaloy
From: Jon Maloy We simplify the call signatures for tipc_nametbl_insert_publ() and tipc_publ_create() so that fewer parameters are passed around. Signed-off-by: Jon Maloy --- net/tipc/name_distr.c | 23 net/tipc/name_table.c | 61 +++

[tipc-discussion] [net-next 15/16] tipc: add host-endian copy of user subscription to struct tipc_subscription

2020-12-08 Thread jmaloy
From: Jon Maloy We reduce and localize the usage of the tipc_sub_xx() macros by adding a corresponding member, with fields set in host-endian format, to struct tipc_subscription. Signed-off-by: Jon Maloy --- net/tipc/name_table.c | 29 +++- net/tipc/subscr.c | 45

[tipc-discussion] [net-next 12/16] tipc: simplify signature of tipc_service_find_range()

2020-12-08 Thread jmaloy
From: Jon Maloy We simplify the signatures of the functions tipc_service_create_range() and tipc_service_finc_range(). Signed-off-by: Jon Maloy --- net/tipc/name_table.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/tipc/name_table.c

[tipc-discussion] [net-next 06/16] tipc: simplify signature of tipc_nametbl_withdraw() functions

2020-12-08 Thread jmaloy
From: Jon Maloy Following the priniciples of the preceding commits, we reduce the number of parameters passed along in tipc_sk_withdraw(), tipc_nametbl_withdraw() and associated functions. Signed-off-by: Jon Maloy --- net/tipc/name_distr.c | 11 net/tipc/name_table.c | 54

[tipc-discussion] [net-next 09/16] tipc: simplify signature of tipc_namtbl_lookup_mcast_sockets()

2020-12-08 Thread jmaloy
From: Jon Maloy We reduce the signature of this function according to the same principle as the preceding commits. Signed-off-by: Jon Maloy --- net/tipc/name_table.c | 10 +- net/tipc/name_table.h | 5 ++--- net/tipc/socket.c | 22 +++--- 3 files changed, 18

[tipc-discussion] [net-next 13/16] tipc: simplify signature of tipc_find_service()

2020-12-08 Thread jmaloy
From: Jon Maloy We reduce the signature of tipc_find_service() and tipc_create_service(). The reason for doing this might not be obvious, but we plan to let struct tipc_uaddr contain information that is relevant for these functions in a later commit. Signed-off-by: Jon Maloy ---

[tipc-discussion] [net-next 11/16] tipc: simplify signature of tipc_nametbl_lookup_group()

2020-12-08 Thread jmaloy
From: Jon Maloy We reduce the signature of tipc_nametbl_lookup_group() by using a struct tipc_uaddr pointer. This entails a couple of minor changes in the functions tipc_send_group_mcast/anycast/unicast/bcast() in socket.c Signed-off-by: Jon Maloy --- net/tipc/name_table.c | 14 +++---

Re: [tipc-discussion] [PATCH] net: tipc: prevent possible null deref of link

2020-12-08 Thread David Miller
From: Cengiz Can Date: Mon, 7 Dec 2020 11:14:24 +0300 > `tipc_node_apply_property` does a null check on a `tipc_link_entry` > pointer but also accesses the same pointer out of the null check block. > > This triggers a warning on Coverity Static Analyzer because we're > implying that `e->link`