diff --git a/slcand.c b/slcand.c index c32c1bb..9d97b3e 100644 --- a/slcand.c +++ b/slcand.c @@ -39,6 +39,7 @@ #include #include #include +#include #include /* Change this to whatever your daemon is called */ @@ -310,6 +311,13 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + // Because of a recent change in linux - https://patchwork.kernel.org/patch/9589541/ + // we need to set low latency flag to get proper receive latency + struct serial_struct snew; + ioctl (fd, TIOCGSERIAL, &snew); + snew.flags |= ASYNC_LOW_LATENCY; + ioctl (fd, TIOCSSERIAL, &snew); + /* Get old values for later restore */ old_ispeed = cfgetispeed(&tios); old_ospeed = cfgetospeed(&tios);