@@ -111,8 +111,6 @@ static void tipc_link_build_proto_msg(struct tipc_link *l, int mtyp, bool probe,
111
111
static void link_reset_statistics (struct tipc_link * l_ptr );
112
112
static void link_print (struct tipc_link * l_ptr , const char * str );
113
113
static void tipc_link_sync_rcv (struct tipc_node * n , struct sk_buff * buf );
114
- static int tipc_link_input (struct tipc_link * l , struct sk_buff * skb );
115
- static bool tipc_data_input (struct tipc_link * l , struct sk_buff * skb );
116
114
117
115
/*
118
116
* Simple non-static link routines (i.e. referenced outside this file)
@@ -960,18 +958,18 @@ static int tipc_link_retransm(struct tipc_link *l, int retransm,
960
958
* Consumes buffer if message is of right type
961
959
* Node lock must be held
962
960
*/
963
- static bool tipc_data_input (struct tipc_link * link , struct sk_buff * skb )
961
+ static bool tipc_data_input (struct tipc_link * link , struct sk_buff * skb ,
962
+ struct sk_buff_head * inputq )
964
963
{
965
964
struct tipc_node * node = link -> owner ;
966
- struct tipc_msg * msg = buf_msg (skb );
967
965
968
- switch (msg_user (msg )) {
966
+ switch (msg_user (buf_msg ( skb ) )) {
969
967
case TIPC_LOW_IMPORTANCE :
970
968
case TIPC_MEDIUM_IMPORTANCE :
971
969
case TIPC_HIGH_IMPORTANCE :
972
970
case TIPC_CRITICAL_IMPORTANCE :
973
971
case CONN_MANAGER :
974
- skb_queue_tail ( link -> inputq , skb );
972
+ __skb_queue_tail ( inputq , skb );
975
973
return true;
976
974
case NAME_DISTRIBUTOR :
977
975
node -> bclink .recv_permitted = true;
@@ -993,7 +991,8 @@ static bool tipc_data_input(struct tipc_link *link, struct sk_buff *skb)
993
991
*
994
992
* Consumes buffer
995
993
*/
996
- static int tipc_link_input (struct tipc_link * l , struct sk_buff * skb )
994
+ static int tipc_link_input (struct tipc_link * l , struct sk_buff * skb ,
995
+ struct sk_buff_head * inputq )
997
996
{
998
997
struct tipc_node * node = l -> owner ;
999
998
struct tipc_msg * hdr = buf_msg (skb );
@@ -1016,7 +1015,7 @@ static int tipc_link_input(struct tipc_link *l, struct sk_buff *skb)
1016
1015
hdr = buf_msg (skb );
1017
1016
if (less (msg_seqno (hdr ), l -> drop_point ))
1018
1017
goto drop ;
1019
- if (tipc_data_input (l , skb ))
1018
+ if (tipc_data_input (l , skb , inputq ))
1020
1019
return rc ;
1021
1020
usr = msg_user (hdr );
1022
1021
reasm_skb = & l -> failover_reasm_skb ;
@@ -1026,13 +1025,13 @@ static int tipc_link_input(struct tipc_link *l, struct sk_buff *skb)
1026
1025
l -> stats .recv_bundles ++ ;
1027
1026
l -> stats .recv_bundled += msg_msgcnt (hdr );
1028
1027
while (tipc_msg_extract (skb , & iskb , & pos ))
1029
- tipc_data_input (l , iskb );
1028
+ tipc_data_input (l , iskb , inputq );
1030
1029
return 0 ;
1031
1030
} else if (usr == MSG_FRAGMENTER ) {
1032
1031
l -> stats .recv_fragments ++ ;
1033
1032
if (tipc_buf_append (reasm_skb , & skb )) {
1034
1033
l -> stats .recv_fragmented ++ ;
1035
- tipc_data_input (l , skb );
1034
+ tipc_data_input (l , skb , inputq );
1036
1035
} else if (!* reasm_skb ) {
1037
1036
return tipc_link_fsm_evt (l , LINK_FAILURE_EVT );
1038
1037
}
@@ -1070,10 +1069,13 @@ int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
1070
1069
struct sk_buff_head * xmitq )
1071
1070
{
1072
1071
struct sk_buff_head * arrvq = & l -> deferdq ;
1072
+ struct sk_buff_head tmpq ;
1073
1073
struct tipc_msg * hdr ;
1074
1074
u16 seqno , rcv_nxt ;
1075
1075
int rc = 0 ;
1076
1076
1077
+ __skb_queue_head_init (& tmpq );
1078
+
1077
1079
if (unlikely (!__tipc_skb_queue_sorted (arrvq , skb ))) {
1078
1080
if (!(skb_queue_len (arrvq ) % TIPC_NACK_INTV ))
1079
1081
tipc_link_build_proto_msg (l , STATE_MSG , 0 ,
@@ -1095,7 +1097,7 @@ int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
1095
1097
rc = tipc_link_fsm_evt (l , LINK_ESTABLISH_EVT );
1096
1098
if (!link_is_up (l )) {
1097
1099
kfree_skb (__skb_dequeue (arrvq ));
1098
- return rc ;
1100
+ goto exit ;
1099
1101
}
1100
1102
}
1101
1103
@@ -1113,7 +1115,7 @@ int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
1113
1115
rcv_nxt = l -> rcv_nxt ;
1114
1116
if (unlikely (less (rcv_nxt , seqno ))) {
1115
1117
l -> stats .deferred_recv ++ ;
1116
- return rc ;
1118
+ goto exit ;
1117
1119
}
1118
1120
1119
1121
__skb_dequeue (arrvq );
@@ -1122,14 +1124,14 @@ int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
1122
1124
if (unlikely (more (rcv_nxt , seqno ))) {
1123
1125
l -> stats .duplicates ++ ;
1124
1126
kfree_skb (skb );
1125
- return rc ;
1127
+ goto exit ;
1126
1128
}
1127
1129
1128
1130
/* Packet can be delivered */
1129
1131
l -> rcv_nxt ++ ;
1130
1132
l -> stats .recv_info ++ ;
1131
- if (unlikely (!tipc_data_input (l , skb )))
1132
- rc = tipc_link_input (l , skb );
1133
+ if (unlikely (!tipc_data_input (l , skb , & tmpq )))
1134
+ rc = tipc_link_input (l , skb , & tmpq );
1133
1135
1134
1136
/* Ack at regular intervals */
1135
1137
if (unlikely (++ l -> rcv_unacked >= TIPC_MIN_LINK_WIN )) {
@@ -1139,6 +1141,8 @@ int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
1139
1141
0 , 0 , 0 , 0 , xmitq );
1140
1142
}
1141
1143
}
1144
+ exit :
1145
+ tipc_skb_queue_splice_tail (& tmpq , l -> inputq );
1142
1146
return rc ;
1143
1147
}
1144
1148
0 commit comments