SIP persistence engine - incorrect search of callid header

To: lvs-devel@xxxxxxxxxxxxxxx
Subject: SIP persistence engine - incorrect search of callid header
From: Marco Angaroni <marcoangaroni@xxxxxxxxx>
Date: Fri, 5 Feb 2016 15:10:15 +0100

the IPVS SIP persistence engine is not able to parse the SIP header
“Call-ID” when such header is inserted in the first positions of the
SIP message.

When IPVS is configured with '--pe sip' option (ex. ipvsadm -A -u -s rr --pe sip -p 120 -o), you can verify that messages
like this one do not create entries in the connection template table
(ipvsadm -Lcn --persistent-conn), .

SIP/2.0 200 OK
Call-ID: a84b4c76e66710@xxxxxxxxxxxxxxxx
Via: SIP/2.0/UDP;branch=z9hG4bK776asdhds
Max-Forwards: 70
To: Bob <sip:bob@xxxxxxxxxx>
From: Alice <sip:alice@xxxxxxxxxxx>;tag=1928301774
CSeq: 314159 INVITE
Contact: <sip:alice@xxxxxxxxxxxxxxxx>
Content-Length: 0

Instead when the “Call-ID” is positioned down (after “From” header for
example), the header is recognized.

This is due to the data offset used in get_callid function call inside
ip_vs_pe_sip.c file: since dptr already points to the start of the SIP
message, the value of dataoff should be initially 0. Otherwise the
header is searched starting from some bytes after the first character
of the SIP message.

This patch , in my tests, solved the problem. I'm using the sources of
kernel 3.10.0-229.20.1.el7.x86_64 (RH7).

 --- a/ip_vs_pe_sip.c 2015-09-24 17:47:25.000000000 +0200
+++ b/ip_vs_pe_sip.c 2016-01-28 15:08:34.309934600 +0100
@@ -88,7 +88,7 @@
dptr = skb->data + dataoff;
datalen = skb->len - dataoff;

- if (get_callid(dptr, dataoff, datalen, &matchoff, &matchlen))
+ if (get_callid(dptr, 0, datalen, &matchoff, &matchlen))
return -EINVAL;

  /* N.B: pe_data is only set on success,

Marco Angaroni
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

<Prev in Thread] Current Thread [Next in Thread>