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: Ravinder Konka <rkonka@codeaurora.org>
This commit is contained in:
Ravinder Konka 2015-03-23 23:57:35 +05:30
parent c3744ea714
commit ae3cd7dd91
1 changed files with 14 additions and 0 deletions

View File

@ -378,7 +378,11 @@ int proc_sip_segment(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);
@ -1821,6 +1825,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;
typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust;
@ -1956,6 +1961,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