4 Commits
v1.5 ... v1.6

Author SHA1 Message Date
Tore Anderson
ff6aa57c4b Release clatd v1.6
Also update copyright year to 2023.
2023-03-05 11:33:00 +01:00
Tore Anderson
a416278570 Make NM/systemd integration more robust
This fixed the following dependency loop that could occur when the
system was booting up:

1. NetworkManager configures a network interface and fires off the clatd
   dispatcher script.
2. The dispatcher scripts tries to restart `clatd.service`.
3. However, `clatd.service` cannot be (re)started at this point because
   its dependency `network-online.target` has not yet been reached.
4. Therefore, the `systemctl restart clatd.service` command in the
   dispatcher script blocks, waiting for `network-online.target` to be
   reached.
5. But that won't happen until the dispatcher scripts finishes...

Adding `--no-block` allows the dispatcher script to finish immediately
without waiting for the restart to complete (instead, systemd will do it
in the background once `network-online.target` has been reached).

Furthermore, since `clatd.service` may end up being restarted several
times during a boot process (especially on a system with many network
interfaces handled by NetworkManager), it is also at risk of
inadvertently triggering the restart rate-limiting feature in systemd,
so disable that while we're at it.

Closes #22. Thanks to @patrakov for the report!
2023-03-05 10:58:29 +01:00
Michal Josef Špaček
4583c592d8 Rewrite obsolete module usage to new one (#20)
Perl module IO::Socket::INET6 is obsolete and recomended one is
IO::Socket::IP, which has compatibility to old one.

btw: Net::DNS was rewrited to use IO::Socket::IP.
2022-11-08 14:43:50 +01:00
Thomas Schäfer
41a312f908 Update Makefile (#14)
Correct iproute2 package name for Debian-based distributions.
2020-02-27 09:23:54 +01:00
6 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014-2019 Tore Anderson <tore@fud.no>
Copyright (c) 2014-2023 Tore Anderson <tore@fud.no>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View File

@@ -23,8 +23,8 @@ install:
installdeps:
# .deb/apt-get based distros
if test -x "$(APT_GET)"; then $(APT_GET) -y install perl-base perl-modules libnet-ip-perl libnet-dns-perl libio-socket-inet6-perl iproute iptables tayga; fi
if test -x "$(APT_GET)"; then $(APT_GET) -y install perl-base perl-modules libnet-ip-perl libnet-dns-perl libio-socket-ip-perl iproute2 iptables tayga; fi
# .rpm/DNF/YUM-based distros
if test -x "$(DNF_OR_YUM)"; then $(DNF_OR_YUM) -y install perl perl-Net-IP perl-Net-DNS perl-IO-Socket-INET6 perl-File-Temp iproute iptables; fi
if test -x "$(DNF_OR_YUM)"; then $(DNF_OR_YUM) -y install perl perl-Net-IP perl-Net-DNS perl-IO-Socket-IP perl-File-Temp iproute iptables; fi
# If necessary, try to install the TAYGA .rpm using dnf/yum. It is unfortunately not available in all .rpm based distros (in particular CentOS/RHEL).
if test -x "$(DNF_OR_YUM)" && test ! -x "$(TAYGA)"; then $(DNF_OR_YUM) -y install tayga || echo "ERROR: Failed to install TAYGA using dnf/yum, the package is probably not included in your distro. Try enabling the EPEL repo <URL: https://fedoraproject.org/wiki/EPEL> and try again, or install TAYGA <URL: http://www.litech.org/tayga> directly from source."; exit 1; fi

View File

@@ -412,7 +412,7 @@ configuration file) when reporting a bug.
=head1 LICENCE
Copyright (c) 2014-2019 Tore Anderson <tore@fud.no>
Copyright (c) 2014-2023 Tore Anderson <tore@fud.no>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

6
clatd
View File

@@ -1,6 +1,6 @@
#! /usr/bin/perl -w
#
# Copyright (c) 2014-2019 Tore Anderson <tore@fud.no>
# Copyright (c) 2014-2023 Tore Anderson <tore@fud.no>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +26,7 @@
use strict;
use Net::IP;
my $VERSION = "1.5";
my $VERSION = "1.6";
#
# Populate the global config hash with the default values
@@ -328,7 +328,7 @@ sub find_rfc7050_wka {
sub get_plat_prefix {
p("Performing DNS64-based PLAT prefix discovery (cf. RFC 7050)");
require IO::Socket::INET6; # needed by Net::DNS for querying IPv6 servers
require IO::Socket::IP; # needed by Net::DNS for querying IPv6 servers
require Net::DNS;
my @dns64_servers = split(",", cfg("dns64-servers") || "");

View File

@@ -27,7 +27,7 @@
# systemd-based distros
if which systemctl &> /dev/null; then
systemctl restart clatd.service
systemctl --no-block restart clatd.service
fi
# upstart-based distros

View File

@@ -12,6 +12,7 @@
Description=464XLAT CLAT daemon
Documentation=man:clatd(8)
After=network-online.target
StartLimitIntervalSec=0
[Service]
Type=simple