mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
tipc: clean up socket layer message reception
When a message is received in a socket, one of the call chains tipc_sk_rcv()->tipc_sk_enqueue()->filter_rcv()(->tipc_sk_proto_rcv()) or tipc_sk_backlog_rcv()->filter_rcv()(->tipc_sk_proto_rcv()) are followed. At each of these levels we may encounter situations where the message may need to be rejected, or a new message produced for transfer back to the sender. Despite recent improvements, the current code for doing this is perceived as awkward and hard to follow. Leveraging the two previous commits in this series, we now introduce a more uniform handling of such situations. We let each of the functions in the chain itself produce/reverse the message to be returned to the sender, but also perform the actual forwarding. This simplifies the necessary logics within each function. Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bcd3ffd4f6
commit
cda3696d3d
4 changed files with 134 additions and 146 deletions
|
@ -798,8 +798,7 @@ bool tipc_msg_make_bundle(struct sk_buff **skb, struct tipc_msg *msg,
|
|||
bool tipc_msg_extract(struct sk_buff *skb, struct sk_buff **iskb, int *pos);
|
||||
int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
|
||||
int offset, int dsz, int mtu, struct sk_buff_head *list);
|
||||
bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, u32 *dnode,
|
||||
int *err);
|
||||
bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, int *err);
|
||||
struct sk_buff *tipc_msg_reassemble(struct sk_buff_head *list);
|
||||
|
||||
static inline u16 buf_seqno(struct sk_buff *skb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue