diff --git a/src/kiss.c b/src/kiss.c index 903ba77..dc0ab5d 100644 --- a/src/kiss.c +++ b/src/kiss.c @@ -210,10 +210,17 @@ ssize_t patty_kiss_tnc_recv(patty_kiss_tnc *tnc, void **frame, int *port) { */ memset(tnc->frame, '\0', tnc->bufsz); + /* + * Try to decode the TNC buffer into the packet. + */ if ((decoded = tnc_decode(tnc, tnc->frame, &framelen, port)) < 0) { goto error_io; } + /* + * If we have decoded frame data, then flush the buffer up to the point of + * the next frame start, if present. + */ if (decoded) { tnc_flush(tnc, decoded); }