Purge through the control socket
[tinc] / src / control.c
index 19ac37a..2c5d4be 100644 (file)
@@ -97,6 +97,12 @@ static void handle_control_data(struct bufferevent *event, void *data) {
                goto respond;
        }
 
+       if(req.type == REQ_PURGE) {
+               logger(LOG_NOTICE, _("Got '%s' command"), "purge");
+               purge();
+               goto respond;
+       }
+
        logger(LOG_DEBUG, _("Malformed control command received"));
        res.res_errno = EINVAL;