Skip to contentSkip to conversation

IPVS: skb defrag in L7 helpers

PATCH In review Hans Schillstrom 2 participants 2 messages Nov 16, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/7 IPVS: skb defrag in L7 helpers

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

*v3
Removed unneeded if (skb_shinfo(skb)->nr_frags)
from Julian.

---
 net/netfilter/ipvs/ip_vs_pe_sip.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
net/netfilter/ipvs/ip_vs_pe_sip.c +3 -0
index b8b4e96..0d83bc0 100644
@@ -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;
 
Signature · 1 line
1.7.2.3
maintainer
#1 lore raw

Hello,

Quoted 2 lines · Hans Schillstrom

L7 helpers like sip needs skb defrag
since L7 data can be fragmented.

I now see that something is missing here,
ip_vs_conn_fill_param_persist does not propagate the error code from fill_param and then to *ignored flag in ip_vs_sched_persist. This problem was discussed on November 08.

Regards

--
Julian Anastasov <[email protected]>