Skip to content

Commit

Permalink
core: enhance error log for un-parsable msg by adding the source IP a…
Browse files Browse the repository at this point in the history
…nd port

(cherry picked from commit 57e6092)
  • Loading branch information
ovidiusas committed Oct 29, 2013
1 parent f1bce75 commit 2a2ded4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion receive.c
Expand Up @@ -88,6 +88,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
{
struct sip_msg* msg;
struct timeval start;
char *tmp;

msg=pkg_malloc(sizeof(struct sip_msg));
if (msg==0) {
Expand All @@ -108,7 +109,8 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
msg->set_global_port=default_global_port;

if (parse_msg(buf,len, msg)!=0){
LM_ERR("parse_msg failed\n");
tmp=ip_addr2a(&(rcv_info->src_ip));
LM_ERR("Unable to parse msg received from [%s:%d]\n", tmp, rcv_info->src_port);
/* if a REQUEST msg was detected (first line was succesfully parsed) we
should trigger the error route */
if ( msg->first_line.type==SIP_REQUEST && error_rlist.a!=NULL )
Expand Down

0 comments on commit 2a2ded4

Please sign in to comment.