]> tinc-vpn.org Git - tinc/blobdiff - src/linux/device.c
Introducing the Big Tinc Lock.
[tinc] / src / linux / device.c
index c1ca0a21dcde9915de6f0b9f2ea5d22148f524bd..40711cccca5b8f4d1b730ee29821fca9eb2e750e 100644 (file)
@@ -61,7 +61,9 @@ static void read_thread(void *arg) {
 
        while(true) {
                if(read_packet(&packet)) {
+                       mutex_lock(&mutex);
                        route(myself, &packet);
+                       mutex_unlock(&mutex);
                } else {
                        if(errno == EAGAIN || errno == EINTR) {
                                errno = 0;