From 21b78de0885abc077fecf1968f53f9eb0905f7bd Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Fri, 27 Jun 2014 19:48:41 -0400 Subject: [PATCH] Increase fixed filename sizes in SLIP tunnels Long serial port names like /dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_DN0038W8-if00-port0 cause crashes. This is the simplest fix to avoid the problem. --- tools/tapslip6.c | 4 ++-- tools/tunslip.c | 4 ++-- tools/tunslip6.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/tapslip6.c b/tools/tapslip6.c index baf0b3e63..86fa37dae 100644 --- a/tools/tapslip6.c +++ b/tools/tapslip6.c @@ -65,7 +65,7 @@ void write_to_serial(int outfd, void *inbuf, int len); #define USAGE_STRING "usage: tapslip6 [-B baudrate] [-s siodev] [-t tundev] ipaddress netmask" -char tundev[32] = { "tap0" }; +char tundev[1024] = { "tap0" }; int ssystem(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); @@ -360,7 +360,7 @@ stty_telos(int fd) int devopen(const char *dev, int flags) { - char t[32]; + char t[1024]; strcpy(t, "/dev/"); strcat(t, dev); return open(t, flags); diff --git a/tools/tunslip.c b/tools/tunslip.c index f08cc45fe..371418f53 100644 --- a/tools/tunslip.c +++ b/tools/tunslip.c @@ -152,7 +152,7 @@ in_addr_t giaddr; in_addr_t netaddr; in_addr_t circuit_addr; -char tundev[32] = { "tun0" }; +char tundev[1024] = { "tun0" }; struct sockaddr_in dhaddr; int dhsock = -1; @@ -747,7 +747,7 @@ stty_telos(int fd) int devopen(const char *dev, int flags) { - char t[32]; + char t[1024]; strcpy(t, "/dev/"); strcat(t, dev); return open(t, flags); diff --git a/tools/tunslip6.c b/tools/tunslip6.c index 0a5337ffc..65e440800 100644 --- a/tools/tunslip6.c +++ b/tools/tunslip6.c @@ -74,7 +74,7 @@ void slip_send_char(int fd, unsigned char c); //#define PROGRESS(s) fprintf(stderr, s) #define PROGRESS(s) do { } while (0) -char tundev[32] = { "" }; +char tundev[1024] = { "" }; int ssystem(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); @@ -497,7 +497,7 @@ stty_telos(int fd) int devopen(const char *dev, int flags) { - char t[32]; + char t[1024]; strcpy(t, "/dev/"); strncat(t, dev, sizeof(t) - 5); return open(t, flags);