netcat: make netcat-openbsd the default netcat (#19411)

The motivation for this change is the following: As gnu-netcat,
e. g. does not support ipv6, it is not suitable as default netcat.

This commit also fixes all obvious build issues caused by this change.

+22 -20
+2 -2
nixos/tests/hibernate.nix
··· 13 13 14 14 networking.firewall.allowedTCPPorts = [ 4444 ]; 15 15 16 - systemd.services.listener.serviceConfig.ExecStart = "${pkgs.netcat}/bin/nc -l -p 4444"; 16 + systemd.services.listener.serviceConfig.ExecStart = "${pkgs.netcat}/bin/nc -l 4444"; 17 17 }; 18 18 19 19 probe = { config, lib, pkgs, ...}: { ··· 36 36 $machine->waitForShutdown; 37 37 $machine->start; 38 38 $probe->waitForUnit("network.target"); 39 - $probe->waitUntilSucceeds("echo test | nc -c machine 4444"); 39 + $probe->waitUntilSucceeds("echo test | nc machine 4444"); 40 40 ''; 41 41 42 42 })
+6 -6
nixos/tests/virtualbox.nix
··· 299 299 -pf /run/dhclient.pid \ 300 300 -v eth0 eth1 301 301 302 - otherIP="$(${pkgs.netcat}/bin/netcat -clp 1234 || :)" 302 + otherIP="$(${pkgs.netcat}/bin/nc -l 1234 || :)" 303 303 ${pkgs.iputils}/bin/ping -I eth1 -c1 "$otherIP" 304 - echo "$otherIP reachable" | ${pkgs.netcat}/bin/netcat -clp 5678 || : 304 + echo "$otherIP reachable" | ${pkgs.netcat}/bin/nc -l 5678 || : 305 305 ''; 306 306 307 307 sysdDetectVirt = pkgs: '' ··· 461 461 my $test1IP = waitForIP_test1 1; 462 462 my $test2IP = waitForIP_test2 1; 463 463 464 - $machine->succeed("echo '$test2IP' | netcat -c '$test1IP' 1234"); 465 - $machine->succeed("echo '$test1IP' | netcat -c '$test2IP' 1234"); 464 + $machine->succeed("echo '$test2IP' | nc '$test1IP' 1234"); 465 + $machine->succeed("echo '$test1IP' | nc '$test2IP' 1234"); 466 466 467 - $machine->waitUntilSucceeds("netcat -c '$test1IP' 5678 >&2"); 468 - $machine->waitUntilSucceeds("netcat -c '$test2IP' 5678 >&2"); 467 + $machine->waitUntilSucceeds("nc '$test1IP' 5678 >&2"); 468 + $machine->waitUntilSucceeds("nc '$test2IP' 5678 >&2"); 469 469 470 470 shutdownVM_test1; 471 471 shutdownVM_test2;
+2 -2
pkgs/applications/misc/playonlinux/default.nix
··· 7 7 , gnupg1compat 8 8 , icoutils 9 9 , imagemagick 10 - , netcat 10 + , netcat-gnu 11 11 , p7zip 12 12 , python2Packages 13 13 , unzip ··· 34 34 gnupg1compat 35 35 icoutils 36 36 imagemagick 37 - netcat 37 + netcat-gnu 38 38 p7zip 39 39 unzip 40 40 wget
+2 -2
pkgs/build-support/vm/windows/bootstrap.nix
··· 1 1 { stdenv, fetchurl, vmTools, writeScript, writeText, runCommand, makeInitrd 2 - , python, perl, coreutils, dosfstools, gzip, mtools, netcat, openssh, qemu 2 + , python, perl, coreutils, dosfstools, gzip, mtools, netcat-gnu, openssh, qemu 3 3 , samba, socat, vde2, cdrkit, pathsFromGraph, gnugrep 4 4 }: 5 5 ··· 10 10 let 11 11 controller = import ./controller { 12 12 inherit stdenv writeScript vmTools makeInitrd; 13 - inherit samba vde2 openssh socat netcat coreutils gzip gnugrep; 13 + inherit samba vde2 openssh socat netcat-gnu coreutils gzip gnugrep; 14 14 }; 15 15 16 16 mkCygwinImage = import ./cygwin-iso {
+3 -3
pkgs/build-support/vm/windows/controller/default.nix
··· 1 1 { stdenv, writeScript, vmTools, makeInitrd 2 - , samba, vde2, openssh, socat, netcat, coreutils, gnugrep, gzip 2 + , samba, vde2, openssh, socat, netcat-gnu, coreutils, gnugrep, gzip 3 3 }: 4 4 5 5 { sshKey ··· 79 79 ${coreutils}/bin/chmod 600 /ssh.key 80 80 '' + (if installMode then '' 81 81 echo -n "Waiting for Windows installation to finish..." 82 - while ! ${netcat}/bin/netcat -z 192.168.0.1 22; do 82 + while ! ${netcat-gnu}/bin/netcat -z 192.168.0.1 22; do 83 83 echo -n . 84 84 # Print a dot every 10 seconds only to shorten line length. 85 85 ${coreutils}/bin/sleep 10 ··· 118 118 ${samba}/sbin/smbd -D 119 119 120 120 echo -n "Waiting for Windows VM to become available..." 121 - while ! ${netcat}/bin/netcat -z 192.168.0.1 22; do 121 + while ! ${netcat-gnu}/bin/netcat -z 192.168.0.1 22; do 122 122 echo -n . 123 123 ${coreutils}/bin/sleep 1 124 124 done
+1 -1
pkgs/build-support/vm/windows/default.nix
··· 3 3 let 4 4 bootstrapper = import ./bootstrap.nix { 5 5 inherit (pkgs) stdenv vmTools writeScript writeText runCommand makeInitrd; 6 - inherit (pkgs) coreutils dosfstools gzip mtools netcat openssh qemu samba; 6 + inherit (pkgs) coreutils dosfstools gzip mtools netcat-gnu openssh qemu samba; 7 7 inherit (pkgs) socat vde2 fetchurl python perl cdrkit pathsFromGraph; 8 8 inherit (pkgs) gnugrep; 9 9 };
+3 -3
pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin.nix
··· 1 1 { stdenv, fetchurl, pkgconfig, intltool, gnome2, libxfce4ui, 2 - libxfce4util, xfce4panel, libnotify, lm_sensors, hddtemp, netcat 2 + libxfce4util, xfce4panel, libnotify, lm_sensors, hddtemp, netcat-gnu 3 3 }: 4 4 5 5 stdenv.mkDerivation rec { ··· 26 26 libnotify 27 27 lm_sensors 28 28 hddtemp 29 - netcat 29 + netcat-gnu 30 30 ]; 31 31 32 32 enableParallelBuilding = true; 33 33 34 34 configureFlags = [ 35 35 "--with-pathhddtemp=${hddtemp}/bin/hddtemp" 36 - "--with-pathnetcat=${netcat}/bin/netcat" 36 + "--with-pathnetcat=${netcat-gnu}/bin/netcat" 37 37 ]; 38 38 39 39 meta = {
pkgs/tools/networking/netcat/default.nix pkgs/tools/networking/netcat-gnu/default.nix
+3 -1
pkgs/top-level/all-packages.nix
··· 2795 2795 2796 2796 netboot = callPackage ../tools/networking/netboot {}; 2797 2797 2798 - netcat = callPackage ../tools/networking/netcat { }; 2798 + netcat = netcat-openbsd; 2799 + 2800 + netcat-gnu = callPackage ../tools/networking/netcat-gnu { }; 2799 2801 2800 2802 netcat-openbsd = callPackage ../tools/networking/netcat-openbsd { }; 2801 2803