addr, sizeof addr, port, sizeof port);
sp->addr = WS_Dup(sp->ws, addr);
sp->port = WS_Dup(sp->ws, port);
- VSL(SLT_SessionOpen, sp->fd, "%s %s %s",
- sp->addr, sp->port, sp->mylsock->name);
+ if (params->log_local_addr) {
+ AZ(getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen));
+ TCP_name(sp->mysockaddr, sp->mysockaddrlen,
+ addr, sizeof addr, port, sizeof port);
+ VSL(SLT_SessionOpen, sp->fd, "%s %s %s %s",
+ sp->addr, sp->port, addr, port);
+ } else {
+ VSL(SLT_SessionOpen, sp->fd, "%s %s %s",
+ sp->addr, sp->port, sp->mylsock->name);
+ }
sp->acct.first = sp->t_open;
if (need_test)
sock_test(sp->fd);
"Log the hash string to shared memory log.\n",
0,
"off", "bool" },
+ { "log_local_address", tweak_bool, &master.log_local_addr, 0, 0,
+ "Log the local address on the TCP connection in the "
+ "SessionOpen shared memory record.\n",
+ 0,
+ "off", "bool" },
{ "diag_bitmap", tweak_diag_bitmap, 0, 0, 0,
"Bitmap controlling diagnostics code:\n"
" 0x00000001 - CNT_Session states.\n"