From 9fefb9e3cdebcefa681672423d23ccc72ae6c165 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 5 Dec 2017 16:30:43 +0200 Subject: [PATCH 1/3] Do not set `net.ipv4.conf.default.*` It is redundant because in these cases the values in `net.ipv4.conf.all.*` take precedence. Also, setting the `default` does nothing for devices that already exist. --- sysctl.d/50-default.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/sysctl.d/50-default.conf b/sysctl.d/50-default.conf index aff99300d94..e263cf06284 100644 --- a/sysctl.d/50-default.conf +++ b/sysctl.d/50-default.conf @@ -22,15 +22,12 @@ kernel.sysrq = 16 kernel.core_uses_pid = 1 # Source route verification -net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 # Do not accept source routing -net.ipv4.conf.default.accept_source_route = 0 net.ipv4.conf.all.accept_source_route = 0 # Promote secondary addresses when the primary address is removed -net.ipv4.conf.default.promote_secondaries = 1 net.ipv4.conf.all.promote_secondaries = 1 # Fair Queue CoDel packet scheduler to fight bufferbloat From 8e1a72535cf74e5e66017c33f9b0a701f34ae179 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 5 Dec 2017 16:49:00 +0200 Subject: [PATCH 2/3] networkd: fix promote_secondaries logic The value for `default` has no influence at all. --- src/network/networkd-dhcp4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index cacd867f9b0..5ce03e5d40c 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -627,7 +627,7 @@ int dhcp4_set_promote_secondaries(Link *link) { * interface. If it is not globally enabled or enabled for the * specific interface we must either enable it. */ - if (!(promote_secondaries_enabled("all") || promote_secondaries_enabled("default") || promote_secondaries_enabled(link->ifname))) { + if (!(promote_secondaries_enabled("all") || promote_secondaries_enabled(link->ifname))) { char *promote_secondaries_path = NULL; log_link_debug(link, "promote_secondaries is unset, setting it"); From 3f550c31b312538c92e76f176e54d3f217662cda Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 5 Dec 2017 16:51:23 +0200 Subject: [PATCH 3/3] networkd: fix memory leak in promote_secondaries_enabled --- src/network/networkd-dhcp4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 5ce03e5d40c..ac1781d83ee 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -590,7 +590,8 @@ static int dhcp4_set_hostname(Link *link) { } static bool promote_secondaries_enabled(const char *ifname) { - char *promote_secondaries_sysctl, *promote_secondaries_path; + _cleanup_free_ char *promote_secondaries_sysctl = NULL; + char *promote_secondaries_path; int r; promote_secondaries_path = strjoina("net/ipv4/conf/", ifname, "/promote_secondaries");