summaryrefslogtreecommitdiff
path: root/accel-pppd/logs/log_tcp.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-04-05 11:12:44 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-04-05 11:12:44 +0300
commit101ae68a9fbe5f0a3d3426ff1a9fb0f763596cc7 (patch)
treeab62ab2edbf98f3a98989cacebeb878672d86cef /accel-pppd/logs/log_tcp.c
parenta730a45b5a3325d62ff5cdb3a7782fc258331033 (diff)
downloadaccel-ppp-101ae68a9fbe5f0a3d3426ff1a9fb0f763596cc7.tar.gz
accel-ppp-101ae68a9fbe5f0a3d3426ff1a9fb0f763596cc7.zip
improved logging: if session's interface is empty log ctrl's interface
Diffstat (limited to 'accel-pppd/logs/log_tcp.c')
-rw-r--r--accel-pppd/logs/log_tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/accel-pppd/logs/log_tcp.c b/accel-pppd/logs/log_tcp.c
index 616809f0..85edf70a 100644
--- a/accel-pppd/logs/log_tcp.c
+++ b/accel-pppd/logs/log_tcp.c
@@ -137,7 +137,7 @@ static void set_hdr(struct log_msg_t *msg, struct ap_session *ses)
localtime_r(&msg->timestamp.tv_sec, &tm);
strftime(timestamp, sizeof(timestamp), "%Y-%m-%d %H:%M:%S", &tm);
- sprintf(msg->hdr->msg, "[%s]: %s: %s: ", timestamp, level_name[msg->level], ses ? ses->ifname : "");
+ sprintf(msg->hdr->msg, "[%s]: %s: %s: ", timestamp, level_name[msg->level], ses ? (ses->ifname[0] ? ses->ifname : ses->ctrl->ifname) : "");
msg->hdr->len = strlen(msg->hdr->msg);
}