Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24e2110f authored by Ravinder Konka's avatar Ravinder Konka
Browse files

netfilter: Fix to MO call issue



Changes to copy the second half of the combined buffer before
splitting the skb. This solves the issue where MO call does
not go through because the second buffer is not correctly
updated.

Change-Id: Ic00d26c5ce1bde3d56b6d141dc581b98f5b355b5
Signed-off-by: default avatarRavinder Konka <rkonka@codeaurora.org>
parent 7427cd00
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -371,8 +371,11 @@ int proc_sip_segment(struct ctl_table *ctl, int write,
		     void __user *buffer, size_t *lenp, loff_t *ppos)
{
	int ret;

	unsigned sip_segmentation_status = nf_ct_enable_sip_segmentation;
	ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
	/* If there is no change in value just return. */
	if (sip_segmentation_status == nf_ct_enable_sip_segmentation)
		return ret;
	if (nf_ct_enable_sip_segmentation) {
		pr_debug("registering queue handler\n");
		nf_register_queue_handler(&nf_sip_qh);
@@ -1818,6 +1821,7 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
	enum ip_conntrack_dir dir = IP_CT_DIR_MAX;
	struct sk_buff *combined_skb = NULL;
	bool content_len_exists = 1;
	unsigned int len_skb = 0;

	packet_count++;
	pr_debug("packet count %d\n", packet_count);
@@ -1952,6 +1956,15 @@ destination:
		splitlen = (dir == IP_CT_DIR_ORIGINAL) ?
				ct->segment.skb_len[0] : ct->segment.skb_len[1];
		oldlen = combined_skb->len - protoff;
		if (unlikely(skb_linearize(combined_skb))) {
			pr_debug("Dropping SKB:\n");
			return NF_DROP;
		}
		len_skb = combined_skb->len - splitlen;
		pr_debug("len to copy is %d\n", len_skb);
		skb_copy_from_linear_data_offset(combined_skb,
						 splitlen, skb->data,
						 len_skb);
		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