]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_ct_sip: correct allowed characters in Call-ID SIP header
authorMarco Angaroni <marcoangaroni@gmail.com>
Tue, 30 Aug 2016 16:48:24 +0000 (18:48 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 7 Sep 2016 08:37:58 +0000 (10:37 +0200)
commitcbc19ea5bb749420d6cb9916c24eb13f0cc02961
tree1aec71637af235affc7ae7cbcfb1131f85b09d03
parent3703c5be5921846d90c3795659f88a235cf4e53b
netfilter: nf_ct_sip: correct allowed characters in Call-ID SIP header

Current parsing methods for SIP header Call-ID do not check correctly all
characters allowed by RFC 3261. In particular "," character is allowed
instead of "'" character. As a result Call-ID headers like the following
are discarded by IPVS SIP persistence engine.

Call-ID: -.!%*_+`'~()<>:\"/[]?{}

Above example is composed using all non-alphanumeric characters listed
in RFC 3261 for Call-ID header syntax.

Proposed fix is in nf_conntrack_sip module; function iswordc() checks this
range: (c >= '(' && c <= '/') which includes these characters: ()*+,-./
They are all allowed except ",". Instead "'" is not included in the list.

Below is an extract of relevant SIP ABNF syntax.

Call-ID  =  ( "Call-ID" / "i" ) HCOLON callid
callid   =  word [ "@" word ]

HCOLON  =  *( SP / HTAB ) ":" SWS
SWS     =  [LWS] ; sep whitespace
LWS     =  [*WSP CRLF] 1*WSP ; linear whitespace
WSP     =  SP / HTAB
word    =  1*(alphanum / "-" / "." / "!" / "%" / "*" /
           "_" / "+" / "`" / "'" / "~" /
           "(" / ")" / "<" / ">" /
           ":" / "\" / DQUOTE /
           "/" / "[" / "]" / "?" /
           "{" / "}" )

Signed-off-by: Marco Angaroni <marcoangaroni@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_sip.c