Close tunnel on connrefused.
[userv-utils] / ipif / udptunnel
index 7c977e1..7160cca 100755 (executable)
@@ -245,5 +245,6 @@ for (;;) {
            alarm($timeout) if $timeout;
        }
     }
+    if ($! == ECONNREFUSED) { quit("tunnel closed at remote end"); }
     $! == EAGAIN || warning("receive error: $!");
 }