Skip to content

Commit

Permalink
correctly use ppp vs. pppd in debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbaseman committed May 29, 2018
1 parent 9748fb3 commit 88a0fa6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,20 @@ static os_semaphore_t sem_stop_io;
*/
static void *pppd_read(void *arg)
{
#if HAVE_USR_SBIN_PPPD
char pppd_name[] = "pppd";
#else
char pppd_name[] = "ppp";
#endif
char prefix_buffer[32];
struct tunnel *tunnel = (struct tunnel *) arg;
uint8_t buf[PKT_BUF_SZ];
int first_time = 1;
off_t off_r, off_w;
fd_set read_fd;

snprintf(prefix_buffer, 32, "%s: ", pppd_name);

FD_ZERO(&read_fd);
FD_SET(tunnel->pppd_pty, &read_fd);

Expand Down Expand Up @@ -253,8 +261,8 @@ static void *pppd_read(void *arg)
packet = repacket;
packet->len = pktsize;

log_debug("pppd ---> gateway (%d bytes)\n", packet->len);
log_packet("pppd: ", packet->len, pkt_data(packet));
log_debug("%s ---> gateway (%d bytes)\n", pppd_name, packet->len);
log_packet(prefix_buffer, packet->len, pkt_data(packet));
pool_push(&tunnel->pty_to_ssl_pool, packet);

off_r += frm_len;
Expand Down Expand Up @@ -409,6 +417,11 @@ static void debug_bad_packet(struct tunnel *tunnel, uint8_t *header)
*/
static void *ssl_read(void *arg)
{
#if HAVE_USR_SBIN_PPPD
char pppd_name[] = "pppd";
#else
char pppd_name[] = "ppp";
#endif
struct tunnel *tunnel = (struct tunnel *) arg;
//uint8_t buf[PKT_BUF_SZ];

Expand Down Expand Up @@ -453,7 +466,7 @@ static void *ssl_read(void *arg)
goto exit;
}

log_debug("gateway ---> pppd (%d bytes)\n", packet->len);
log_debug("gateway ---> %s (%d bytes)\n", pppd_name, packet->len);
log_packet("gtw: ", packet->len, pkt_data(packet));
pool_push(&tunnel->ssl_to_pty_pool, packet);

Expand Down

0 comments on commit 88a0fa6

Please sign in to comment.