diff options
Diffstat (limited to 'usr.sbin/ppp/radius.c')
-rw-r--r-- | usr.sbin/ppp/radius.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/usr.sbin/ppp/radius.c b/usr.sbin/ppp/radius.c index 03d4555..8518396 100644 --- a/usr.sbin/ppp/radius.c +++ b/usr.sbin/ppp/radius.c @@ -30,6 +30,7 @@ #include <stdint.h> #include <sys/param.h> +#include <sys/select.h> #include <sys/socket.h> #include <netinet/in_systm.h> #include <netinet/in.h> @@ -681,6 +682,25 @@ radius_Read(struct fdescriptor *d, struct bundle *bundle __unused, } /* + * Flush any pending transactions + */ +void +radius_Flush(struct radius *r) +{ + struct timeval tv; + fd_set s; + + while (r->cx.fd != -1) { + FD_ZERO(&s); + FD_SET(r->cx.fd, &s); + tv.tv_sec = 0; + tv.tv_usec = TICKUNIT; + select(r->cx.fd + 1, &s, NULL, NULL, &tv); + radius_Continue(r, 1); + } +} + +/* * Behave as a struct fdescriptor (descriptor.h) */ static int |