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.

(cherry picked from commit 22f4c1a)
  • Loading branch information
bogdan-iancu committed Aug 10, 2015
1 parent 83cb342 commit 4b3944f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/net_tcp.c
Expand Up @@ -762,10 +762,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(id);
LM_WARN("possible port hijack attempt\n");
LM_WARN("alias already present and points to another connection "
"(%d : %d and %d : %d)\n", a->parent->id, port, c->id, port);
TCPCONN_UNLOCK(id);
return -1;
}

Expand Down

0 comments on commit 4b3944f

Please sign in to comment.