Skip to content

Commit

Permalink
Fix race condition - the log must be under lock
Browse files Browse the repository at this point in the history
As information from the alias strucuture is printed, this must be done under lock protection.
Closes #589 by @dbeskoek.
  • Loading branch information
bogdan-iancu committed Aug 10, 2015
1 parent ad90850 commit a0a6f7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcp_main.c
Expand Up @@ -963,10 +963,10 @@ int tcpconn_add_alias(int id, int port, int proto)
LM_ERR("no connection found for id %d\n",id);
return -1;
error_sec:
TCPCONN_UNLOCK;
LM_ERR("possible port hijack attempt\n");
LM_ERR("alias already present and points to another connection "
"(%d : %d and %d : %d)\n", a->parent->id, port, c->id, port);
TCPCONN_UNLOCK;
return -1;
}

Expand Down

0 comments on commit a0a6f7a

Please sign in to comment.