From bb3726acc2b1b12371688443064f4e50a86f7e51 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 25 Apr 2019 12:46:55 +0200 Subject: [PATCH] device: use nm_platform_sysctl_ip_conf_get_rp_filter_ipv4() for warning about rp-filter --- src/devices/nm-device.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index d313f792cc..2a95efdf9b 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3106,28 +3106,17 @@ concheck_start (NMDevice *self, && !priv->concheck_rp_filter_checked) { if ((ifname = nm_device_get_ip_iface_from_platform (self))) { - int val, val_all; - - val = nm_platform_sysctl_ip_conf_get_int_checked (nm_device_get_platform (self), - AF_INET, - ifname, - "rp_filter", - 10, 0, 2, 3); - if (val < 2) { - val_all = nm_platform_sysctl_ip_conf_get_int_checked (nm_device_get_platform (self), - AF_INET, - "all", - "rp_filter", - 10, 0, 2, val); - if (val_all > val) { - val = val_all; - ifname = "all"; - } - } + gboolean due_to_all; + int val; + val = nm_platform_sysctl_ip_conf_get_rp_filter_ipv4 (nm_device_get_platform (self), + ifname, + TRUE, + &due_to_all); if (val == 1) { _LOGW (LOGD_CONCHECK, "connectivity: \"/proc/sys/net/ipv4/conf/%s/rp_filter\" is set to \"1\". " - "This might break connectivity checking for IPv4 on this device", ifname); + "This might break connectivity checking for IPv4 on this device", + due_to_all ? "all" : ifname); } }