IPVS: skb defrag in L7 helpers
authorHans Schillstrom <hans.schillstrom@ericsson.com>
Fri, 19 Nov 2010 13:25:09 +0000 (14:25 +0100)
committerSimon Horman <horms@verge.net.au>
Thu, 25 Nov 2010 01:42:58 +0000 (10:42 +0900)
L7 helpers like sip needs skb defrag
since L7 data can be fragmented.

This patch requires "IPVS Break ports-2 into src_port and dst_port" patch

Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
net/netfilter/ipvs/ip_vs_pe_sip.c

index b8b4e9620f3e936251da71d452f1d1f7aed68d04..0d83bc01fed4c14d7323debd536c5ca738cd5954 100644 (file)
@@ -71,6 +71,7 @@ ip_vs_sip_fill_param(struct ip_vs_conn_param *p, struct sk_buff *skb)
        struct ip_vs_iphdr iph;
        unsigned int dataoff, datalen, matchoff, matchlen;
        const char *dptr;
+       int retc;
 
        ip_vs_fill_iphdr(p->af, skb_network_header(skb), &iph);
 
@@ -83,6 +84,8 @@ ip_vs_sip_fill_param(struct ip_vs_conn_param *p, struct sk_buff *skb)
        if (dataoff >= skb->len)
                return -EINVAL;
 
+       if ((retc=skb_linearize(skb)) < 0)
+               return retc;
        dptr = skb->data + dataoff;
        datalen = skb->len - dataoff;