tinc_pre: avoid infinite loop with EBADFD on network restart

Volth 688dc4e4 4456076b

Changed files
+11 -2
nixos
modules
services
networking
pkgs
tools
networking
tinc
+2 -1
nixos/modules/services/networking/tinc.nix
···
serviceConfig = {
Type = "simple";
PIDFile = "/run/tinc.${network}.pid";
-
Restart = "on-failure";
+
Restart = "always";
+
RestartSec = "3";
};
preStart = ''
mkdir -p /etc/tinc/${network}/hosts
+9 -1
pkgs/tools/networking/tinc/pre.nix
···
-
{ stdenv, fetchgit, autoreconfHook, texinfo, ncurses, readline, zlib, lzo, openssl }:
+
{ stdenv, fetchgit, fetchpatch, autoreconfHook, texinfo, ncurses, readline, zlib, lzo, openssl }:
stdenv.mkDerivation rec {
name = "tinc-${version}";
···
prePatch = ''
substituteInPlace configure.ac --replace UNKNOWN ${version}
'';
+
+
patches = [
+
# Avoid infinite loop with "Error while reading from Linux tun/tap device (tun mode) /dev/net/tun: File descriptor in bad state" on network restart
+
(fetchpatch {
+
url = https://github.com/gsliepen/tinc/compare/acefa66...e4544db.patch;
+
sha256 = "1jz7anqqzk7j96l5ifggc2knp14fmbsjdzfrbncxx0qhb6ihdcvn";
+
})
+
];
postInstall = ''
rm $out/bin/tinc-gui