Skip to content
Snippets Groups Projects
Forked from pkg / systemd
133 commits behind the upstream repository.
  • Michael Biebl's avatar
    76e351d7
    Import Debian changes 241-7~deb10u1 · 76e351d7
    Michael Biebl authored
    systemd (241-7~deb10u1) buster; urgency=medium
    
      * Rebuild for buster
    
    systemd (241-7) unstable; urgency=medium
    
      [ Michael Biebl ]
      * network: Fix failure to bring up interface with Linux kernel 5.2.
        Backport two patches from systemd master in order to fix a bug with 5.2
        kernels where the network interface fails to come up with the following
        error: "enp3s0: Could not bring up interface: Invalid argument"
        (Closes: #931636)
      * Use /usr/sbin/nologin as nologin shell.
        In Debian the nologin shell is installed in /usr/sbin, not /sbin.
        (Closes: #931850)
    
      [ Mert Dirik ]
      * 40-systemd: Don't fail if SysV init script uses set -u and $1 is unset
        (Closes: #931719)
    
    systemd (241-6) unstable; urgency=medium
    
      * ask-password: Prevent buffer overflow when reading from keyring.
        Fixes a possible memory corruption that causes systemd-cryptsetup to
        crash either when a single large password is used or when multiple
        passwords have already been pushed to the keyring. (Closes: #929726)
      * Clarify documentation regarding %h/%u/%U specifiers.
        Make it clear, that setting "User=" has no effect on those specifiers.
        Also ensure that "%h" is actually resolved to "/root" for the system
        manager instance as documented in the systemd.unit man page.
        (Closes: #927911)
      * network: Behave more gracefully when IPv6 has been disabled.
        Ignore any configured IPv6 settings when IPv6 has been disabled in the
        kernel via sysctl. Instead of failing completely, continue and log a
        warning instead. (Closes: #929469)
    76e351d7
    History
    Import Debian changes 241-7~deb10u1
    Michael Biebl authored
    systemd (241-7~deb10u1) buster; urgency=medium
    
      * Rebuild for buster
    
    systemd (241-7) unstable; urgency=medium
    
      [ Michael Biebl ]
      * network: Fix failure to bring up interface with Linux kernel 5.2.
        Backport two patches from systemd master in order to fix a bug with 5.2
        kernels where the network interface fails to come up with the following
        error: "enp3s0: Could not bring up interface: Invalid argument"
        (Closes: #931636)
      * Use /usr/sbin/nologin as nologin shell.
        In Debian the nologin shell is installed in /usr/sbin, not /sbin.
        (Closes: #931850)
    
      [ Mert Dirik ]
      * 40-systemd: Don't fail if SysV init script uses set -u and $1 is unset
        (Closes: #931719)
    
    systemd (241-6) unstable; urgency=medium
    
      * ask-password: Prevent buffer overflow when reading from keyring.
        Fixes a possible memory corruption that causes systemd-cryptsetup to
        crash either when a single large password is used or when multiple
        passwords have already been pushed to the keyring. (Closes: #929726)
      * Clarify documentation regarding %h/%u/%U specifiers.
        Make it clear, that setting "User=" has no effect on those specifiers.
        Also ensure that "%h" is actually resolved to "/root" for the system
        manager instance as documented in the systemd.unit man page.
        (Closes: #927911)
      * network: Behave more gracefully when IPv6 has been disabled.
        Ignore any configured IPv6 settings when IPv6 has been disabled in the
        kernel via sysctl. Instead of failing completely, continue and log a
        warning instead. (Closes: #929469)
network-ignore-requested-ipv6-addresses-when-ipv6-is-disa.patch 2.38 KiB
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 11 Jun 2019 23:20:56 +0900
Subject: network: ignore requested ipv6 addresses when ipv6 is disabled by
 sysctl

(cherry picked from commit 54a1a535bd60f13964bbddd8f381601e33e8e56f)
---
 src/network/networkd-address.c | 7 ++++++-
 src/network/networkd-link.c    | 4 ++--
 src/network/networkd-ndisc.c   | 4 ++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 3cdbd9e..a9f65e5 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -565,6 +565,11 @@ int address_configure(
         assert(link->manager->rtnl);
         assert(callback);
 
+        if (address->family == AF_INET6 && manager_sysctl_ipv6_enabled(link->manager) == 0) {
+                log_link_warning(link, "An IPv6 address is requested, but IPv6 is disabled by sysctl, ignoring.");
+                return 0;
+        }
+
         /* If this is a new address, then refuse adding more than the limit */
         if (address_get(link, address->family, &address->in_addr, address->prefixlen, NULL) <= 0 &&
             set_size(link->addresses) >= ADDRESSES_PER_LINK_MAX)
@@ -669,7 +674,7 @@ int address_configure(
                 return log_error_errno(r, "Could not add address: %m");
         }
 
-        return 0;
+        return 1;
 }
 
 int config_parse_broadcast(
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 322e701..638aae0 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1123,8 +1123,8 @@ static int link_request_set_addresses(Link *link) {
                         link_enter_failed(link);
                         return r;
                 }
-
-                link->address_messages++;
+                if (r > 0)
+                        link->address_messages++;
         }
 
         LIST_FOREACH(labels, label, link->network->address_labels) {
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index e5b8d11..78c98a0 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -205,8 +205,8 @@ static int ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *r
                 link_enter_failed(link);
                 return r;
         }
-
-        link->ndisc_messages++;
+        if (r > 0)
+                link->ndisc_messages++;
 
         return 0;
 }