[SR-Users] random incorrect method parsing

Daniel-Constantin Mierla miconda at gmail.com
Wed Dec 9 16:41:05 CET 2015


Hello,

good it was caught. I think it is good/safe to skip the '\0' together
with the white spaces at the beginning for the request. I will analyze
the impact and push the patch for it.

Cheers,
Daniel

On 09/12/15 12:05, Vasiliy Ganchev wrote:
> Hi Daniel!
>
> Thank you for the suggestion, after the deep investigation, looks like the
> root of the problem found:
>
> when device send TCP ACK (before INVITE), in this packet is incapsulated
> "VSS-Monitoring ethernet trailer, Source Port: 0", example in file in
> attachment. 
> Looks like kamailio parse it, and add the received /0 to the beginning of
> following SIP request (INVITE), as a result - incorrect Method parsing and
> 400 error.
>
> The way to solve current problem, is to modify the check below:
> --- parser/msg_parser.c	(revision xxxxx)
> +++ parser/msg_parser.c	(working copy)
> @@ -607,7 +607,7 @@
>  	hdr_flags_t flags;
>
>  	/* eat crlf from the beginning */
> -	for (tmp=buf; (*tmp=='\n' || *tmp=='\r')&&
> +	for (tmp=buf; (*tmp=='\n' || *tmp=='\r' || *tmp=='\0')&&
>  			tmp-buf < len ; tmp++);
>
> Do we need such change in kamailio? 
>
> Cheers! issued_packet_with_extra_0.pcap
> <http://sip-router.1086192.n5.nabble.com/file/n143771/issued_packet_with_extra_0.pcap>  
>
>
>
> --
> View this message in context: http://sip-router.1086192.n5.nabble.com/random-incorrect-method-parsing-tp143749p143771.html
> Sent from the Users mailing list archive at Nabble.com.
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu




More information about the sr-users mailing list