Merge "msm-5.4: CPE crash during SIP call"

This commit is contained in:
qctecmdr 2022-04-12 03:19:35 -07:00 committed by Gerrit - the friendly Code Review server
commit 757fbe8895

View File

@ -293,7 +293,7 @@ static void recalc_header(struct sk_buff *skb, unsigned int skblen,
struct tcphdr *tcph;
/* here we recalculate ip and tcp headers */
if (nf_ct_l3num((struct nf_conn *)skb->_nfct) == NFPROTO_IPV4) {
if (nf_ct_l3num((struct nf_conn *)skb_nfct(skb)) == NFPROTO_IPV4) {
/* fix IP hdr checksum information */
ip_hdr(skb)->tot_len = htons(skblen);
ip_send_check(ip_hdr(skb));
@ -303,7 +303,7 @@ static void recalc_header(struct sk_buff *skb, unsigned int skblen,
}
datalen = skb->len - protoff;
tcph = (struct tcphdr *)((void *)skb->data + protoff);
nf_nat_csum_recalc(skb, nf_ct_l3num((struct nf_conn *)skb->_nfct),
nf_nat_csum_recalc(skb, nf_ct_l3num((struct nf_conn *)skb_nfct(skb)),
IPPROTO_TCP, tcph, &tcph->check, datalen, oldlen);
}
@ -1913,6 +1913,9 @@ static void sip_tcp_skb_combined_processing(bool skb_is_combined, struct sk_buff
splitlen = (dir == IP_CT_DIR_ORIGINAL) ?
ct->segment.skb_len[0] : ct->segment.skb_len[1];
oldlen = combined_skb->len - protoff;
/* Reset skb->len and skb->tail params before skb split. */
skb->len = 0;
skb->tail = skb->data;
skb_split(combined_skb, skb, splitlen);
/* Headers need to be recalculated since during SIP processing
* headers are calculated based on the change in length of the