small updates

This commit is contained in:
Nikos Mavrogiannopoulos
2013-02-12 18:57:05 +01:00
parent 8cba144e77
commit fba6115923
5 changed files with 17 additions and 15 deletions
+4 -4
View File
@@ -68,7 +68,7 @@ const char *human_addr(const struct sockaddr *sa, socklen_t salen,
void __attribute__ ((format(printf, 3, 4)))
oclog(const worker_st * ws, int priority, const char *fmt, ...)
{
char buf[1024];
char buf[512];
char ipbuf[128];
const char* ip;
va_list args;
@@ -80,7 +80,7 @@ void __attribute__ ((format(printf, 3, 4)))
ipbuf, sizeof(ipbuf));
va_start(args, fmt);
vsnprintf(buf, sizeof(buf)-1, fmt, args);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
if (ip) {
@@ -97,7 +97,7 @@ void __attribute__ ((format(printf, 4, 5)))
mslog(const main_server_st * s, const struct proc_st* proc,
int priority, const char *fmt, ...)
{
char buf[1024];
char buf[512];
char ipbuf[128];
const char* ip = NULL;
va_list args;
@@ -111,7 +111,7 @@ void __attribute__ ((format(printf, 4, 5)))
}
va_start(args, fmt);
vsnprintf(buf, sizeof(buf)-1, fmt, args);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
if (ip) {
+1
View File
@@ -2,6 +2,7 @@
# define TUN_H
#include <vpn.h>
#include <string.h>
#include <ccan/list/list.h>
struct lease_st {
+2 -2
View File
@@ -393,7 +393,7 @@ struct cmd_auth_req_st areq;
goto auth_fail;
}
oclog(ws, LOG_INFO, "User '%s' logged in\n", ws->username);
oclog(ws, LOG_INFO, "User '%s' logged in", ws->username);
p = str_cookie;
for (i=0;i<sizeof(ws->cookie);i++) {
@@ -509,7 +509,7 @@ struct cmd_auth_req_st areq;
goto auth_fail;
}
oclog(ws, LOG_INFO, "User '%s' logged in\n", ws->username);
oclog(ws, LOG_INFO, "User '%s' logged in", ws->username);
p = str_cookie;
for (i=0;i<sizeof(ws->cookie);i++) {
+4 -4
View File
@@ -130,11 +130,11 @@ struct ifreq ifr;
/* get the remote IPs */
ret = get_ip(ws, fd, AF_INET6, 0, vinfo, &buffer, &buffer_size);
if (ret < 0)
oclog(ws, LOG_DEBUG, "Cannot obtain IPv6 remote IP for %s\n", vinfo->name);
oclog(ws, LOG_DEBUG, "cannot obtain IPv6 remote IP for %s", vinfo->name);
ret = get_ip(ws, fd, AF_INET, 0, vinfo, &buffer, &buffer_size);
if (ret < 0)
oclog(ws, LOG_DEBUG, "Cannot obtain IPv4 remote IP for %s\n", vinfo->name);
oclog(ws, LOG_DEBUG, "cannot obtain IPv4 remote IP for %s", vinfo->name);
if (vinfo->ipv4 == NULL && vinfo->ipv6 == NULL) {
ret = -1;
@@ -144,11 +144,11 @@ struct ifreq ifr;
/* get the local IPs */
ret = get_ip(ws, fd, AF_INET6, 1, vinfo, &buffer, &buffer_size);
if (ret < 0)
oclog(ws, LOG_DEBUG, "Cannot obtain IPv6 local IP for %s\n", vinfo->name);
oclog(ws, LOG_DEBUG, "cannot obtain IPv6 local IP for %s", vinfo->name);
ret = get_ip(ws, fd, AF_INET, 1, vinfo, &buffer, &buffer_size);
if (ret < 0)
oclog(ws, LOG_DEBUG, "Cannot obtain IPv4 local IP for %s\n", vinfo->name);
oclog(ws, LOG_DEBUG, "cannot obtain IPv4 local IP for %s", vinfo->name);
if (vinfo->ipv4_dns && strcmp(vinfo->ipv4_dns, "local") == 0)
+6 -5
View File
@@ -807,7 +807,7 @@ unsigned mtu_overhead, dtls_mtu = 0, tls_mtu = 0;
if (FD_ISSET(ws->conn_fd, &rfds) || tls_pending != 0) {
ret = gnutls_record_recv(ws->session, buffer, sizeof(buffer));
oclog(ws, LOG_DEBUG, "received %d byte(s) (TLS)\n", ret);
oclog(ws, LOG_DEBUG, "received %d byte(s) (TLS)", ret);
GNUTLS_FATAL_ERR(ret);
@@ -839,7 +839,7 @@ unsigned mtu_overhead, dtls_mtu = 0, tls_mtu = 0;
case UP_ACTIVE:
case UP_INACTIVE:
ret = gnutls_record_recv(ws->dtls_session, buffer, sizeof(buffer));
oclog(ws, LOG_DEBUG, "received %d byte(s) (DTLS)\n", ret);
oclog(ws, LOG_DEBUG, "received %d byte(s) (DTLS)", ret);
GNUTLS_FATAL_ERR(ret);
@@ -938,10 +938,10 @@ int ret, e;
switch (head) {
case AC_PKT_DPD_RESP:
oclog(ws, LOG_INFO, "received DPD response");
oclog(ws, LOG_DEBUG, "received DPD response");
break;
case AC_PKT_KEEPALIVE:
oclog(ws, LOG_INFO, "received keepalive");
oclog(ws, LOG_DEBUG, "received keepalive");
break;
case AC_PKT_DPD_OUT:
oclog(ws, LOG_DEBUG, "received DPD; sending response");
@@ -956,7 +956,8 @@ int ret, e;
ws->last_dpd = time(0);
break;
case AC_PKT_DISCONN:
oclog(ws, LOG_INFO, "received BYE packet");
oclog(ws, LOG_INFO, "received BYE packet; exiting");
exit(0);
break;
case AC_PKT_DATA:
oclog(ws, LOG_DEBUG, "writing %d byte(s) to TUN", (int)buf_size);