@@ -1030,21 +1030,25 @@ void tipc_link_reset(struct tipc_link *l)
1030
1030
int tipc_link_xmit (struct tipc_link * l , struct sk_buff_head * list ,
1031
1031
struct sk_buff_head * xmitq )
1032
1032
{
1033
- struct tipc_msg * hdr = buf_msg (skb_peek (list ));
1034
1033
struct sk_buff_head * backlogq = & l -> backlogq ;
1035
1034
struct sk_buff_head * transmq = & l -> transmq ;
1036
1035
struct sk_buff * skb , * _skb ;
1037
1036
u16 bc_ack = l -> bc_rcvlink -> rcv_nxt - 1 ;
1038
1037
u16 ack = l -> rcv_nxt - 1 ;
1039
1038
u16 seqno = l -> snd_nxt ;
1040
1039
int pkt_cnt = skb_queue_len (list );
1041
- int imp = msg_importance (hdr );
1042
1040
unsigned int mss = tipc_link_mss (l );
1043
1041
unsigned int cwin = l -> window ;
1044
1042
unsigned int mtu = l -> mtu ;
1043
+ struct tipc_msg * hdr ;
1045
1044
bool new_bundle ;
1046
1045
int rc = 0 ;
1046
+ int imp ;
1047
+
1048
+ if (pkt_cnt <= 0 )
1049
+ return 0 ;
1047
1050
1051
+ hdr = buf_msg (skb_peek (list ));
1048
1052
if (unlikely (msg_size (hdr ) > mtu )) {
1049
1053
pr_warn ("Too large msg, purging xmit list %d %d %d %d %d!\n" ,
1050
1054
skb_queue_len (list ), msg_user (hdr ),
@@ -1053,6 +1057,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list,
1053
1057
return - EMSGSIZE ;
1054
1058
}
1055
1059
1060
+ imp = msg_importance (hdr );
1056
1061
/* Allow oversubscription of one data msg per source at congestion */
1057
1062
if (unlikely (l -> backlog [imp ].len >= l -> backlog [imp ].limit )) {
1058
1063
if (imp == TIPC_SYSTEM_IMPORTANCE ) {
0 commit comments