From patchwork Sat Nov 7 19:35:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Bernat X-Patchwork-Id: 1396222 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=bernat.ch Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bernat.ch header.i=@bernat.ch header.a=rsa-sha256 header.s=fm1 header.b=Sl9UwgHi; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=bekIypqk; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CT6tT3x98z9sVK for ; Sun, 8 Nov 2020 06:35:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728692AbgKGTff (ORCPT ); Sat, 7 Nov 2020 14:35:35 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:36877 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728663AbgKGTfc (ORCPT ); Sat, 7 Nov 2020 14:35:32 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 94E2ACCF; Sat, 7 Nov 2020 14:35:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 07 Nov 2020 14:35:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bernat.ch; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=GMx5WuDXEk8Gn TjKqIS6xBPu5RBIAbEvVL3CSj1TKNg=; b=Sl9UwgHiYfSKzSGCXJ/SzY8ARAXT8 NncxjI92lktr7uU7rn2VqvsjdoDk2H50LzT++31FQM0tQhH+T1auTZlpt0MsJgdY NGMldNnNaecFrAgcse6oNNF8R/CJCPz7JYhaW1x9sX3xKXXDxrLRdxgyUmb4Ole5 9HTKUlZKnYzBIvq4cTNaLciPHf9HpTwilR5RI7/iC3H3kQsYbnn7yrOyBWX1s13p l46qcAvjf+LmnSrYv/u3zkFrh5i+8wEIOFZkgX9nw8DlZ1qnoiKSNzr3yaZjrHxW 7X0qn7bm3R5/HgpTDGJKC8KNYVXGzmvbRiSti9iLSQJOGu8bDub8c2+EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=GMx5WuDXEk8GnTjKqIS6xBPu5RBIAbEvVL3CSj1TKNg=; b=bekIypqk pV35JmbJuP2YV3g1ILKOPa5nNibmO+ytnfExzCwOb/JT/AlwJhD120bR3Ld2c661 U72xS76P9B2vPLjzUBkFeSbzR31LsPtVMOYrTlmoXzv/qXGOoeUSjTiAbz0mnWV9 mnJoRuOHIQyyAIiA2tEj+VdSidnD/xQqMAJNO9E76eG+YOTdr/1t7W1YBk+LmNHv 9rGS9dqlHY7PIOyMKynNlISuAgFivXERxqs225VYeOC+0dpsk3Gjn7KfHHwlEl5u Qm5mdm9fP0piJH3UiPhgZj/A8Yp+EurxMznCUUIRCEYNkcGqJs26k47tcwktWCUF MY7yrdRxXugFBg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduuddguddvkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepgghinhgt vghnthcuuegvrhhnrghtuceovhhinhgtvghnthessggvrhhnrghtrdgthheqnecuggftrf grthhtvghrnhepieefjeeuieeggeehkeettdeltdehffffjeehtdehlefhtdffteegleeg geduhfejnecukfhppeekiedrvdegvddrkedrudeijeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgrtheslhhufhhfhidrtgig X-ME-Proxy: Received: from neo.luffy.cx (lfbn-idf1-1-619-167.w86-242.abo.wanadoo.fr [86.242.8.167]) by mail.messagingengine.com (Postfix) with ESMTPA id D4D0630614AA; Sat, 7 Nov 2020 14:35:30 -0500 (EST) Received: by neo.luffy.cx (Postfix, from userid 500) id 2545FA17; Sat, 7 Nov 2020 20:35:30 +0100 (CET) From: Vincent Bernat To: "David S. Miller" , Jakub Kicinski , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, Jonathan Corbet Cc: Vincent Bernat Subject: [PATCH net-next v2 1/3] net: evaluate net.ipvX.conf.all.ignore_routes_with_linkdown Date: Sat, 7 Nov 2020 20:35:13 +0100 Message-Id: <20201107193515.1469030-2-vincent@bernat.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201107193515.1469030-1-vincent@bernat.ch> References: <20201107193515.1469030-1-vincent@bernat.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Introduced in 0eeb075fad73, the "ignore_routes_with_linkdown" sysctl ignores a route whose interface is down. It is provided as a per-interface sysctl. However, while a "all" variant is exposed, it was a noop since it was never evaluated. We use the usual "or" logic for this kind of sysctls. Tested with: ip link add type veth # veth0 + veth1 ip link add type veth # veth1 + veth2 ip link set up dev veth0 ip link set up dev veth1 # link-status paired with veth0 ip link set up dev veth2 ip link set up dev veth3 # link-status paired with veth2 # First available path ip -4 addr add 203.0.113.${uts#H}/24 dev veth0 ip -6 addr add 2001:db8:1::${uts#H}/64 dev veth0 # Second available path ip -4 addr add 192.0.2.${uts#H}/24 dev veth2 ip -6 addr add 2001:db8:2::${uts#H}/64 dev veth2 # More specific route through first path ip -4 route add 198.51.100.0/25 via 203.0.113.254 # via veth0 ip -6 route add 2001:db8:3::/56 via 2001:db8:1::ff # via veth0 # Less specific route through second path ip -4 route add 198.51.100.0/24 via 192.0.2.254 # via veth2 ip -6 route add 2001:db8:3::/48 via 2001:db8:2::ff # via veth2 # H1: enable on "all" # H2: enable on "veth0" for v in ipv4 ipv6; do case $uts in H1) sysctl -qw net.${v}.conf.all.ignore_routes_with_linkdown=1 ;; H2) sysctl -qw net.${v}.conf.veth0.ignore_routes_with_linkdown=1 ;; esac done set -xe # When veth0 is up, best route is through veth0 ip -o route get 198.51.100.1 | grep -Fw veth0 ip -o route get 2001:db8:3::1 | grep -Fw veth0 # When veth0 is down, best route should be through veth2 on H1/H2, # but on veth0 on H2 ip link set down dev veth1 # down veth0 ip route show [ $uts != H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth0 [ $uts != H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth0 [ $uts = H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth2 [ $uts = H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth2 Without this patch, the two last lines would fail on H1 (the one using the "all" sysctl). With the patch, everything succeeds as expected. Also document the sysctl in `ip-sysctl.rst`. Fixes: 0eeb075fad73 ("net: ipv4 sysctl option to ignore routes when nexthop link is down") Signed-off-by: Vincent Bernat --- Documentation/networking/ip-sysctl.rst | 3 +++ include/linux/inetdevice.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst index 2aaf40b2d2cd..dd2b12a32b73 100644 --- a/Documentation/networking/ip-sysctl.rst +++ b/Documentation/networking/ip-sysctl.rst @@ -1554,6 +1554,9 @@ igmpv3_unsolicited_report_interval - INTEGER Default: 1000 (1 seconds) +ignore_routes_with_linkdown - BOOLEAN + Ignore routes whose link is down when performing a FIB lookup. + promote_secondaries - BOOLEAN When a primary IP address is removed from this interface promote a corresponding secondary IP address instead of diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 3515ca64e638..3bbcddd22df8 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -126,7 +126,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS))) #define IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev) \ - IN_DEV_CONF_GET((in_dev), IGNORE_ROUTES_WITH_LINKDOWN) + IN_DEV_ORCONF((in_dev), IGNORE_ROUTES_WITH_LINKDOWN) #define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER) #define IN_DEV_ARP_ACCEPT(in_dev) IN_DEV_ORCONF((in_dev), ARP_ACCEPT) From patchwork Sat Nov 7 19:35:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Bernat X-Patchwork-Id: 1396223 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=bernat.ch Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bernat.ch header.i=@bernat.ch header.a=rsa-sha256 header.s=fm1 header.b=Qp77h6hT; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=J6bTOXvF; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CT6tT6pbhz9sTv for ; Sun, 8 Nov 2020 06:35:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728696AbgKGTfh (ORCPT ); Sat, 7 Nov 2020 14:35:37 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:39871 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbgKGTfe (ORCPT ); Sat, 7 Nov 2020 14:35:34 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5BDDCCCB; Sat, 7 Nov 2020 14:35:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 07 Nov 2020 14:35:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bernat.ch; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=l5QoLWgfPvfgu R2DrcmcTAqfnn8C69HIG2XMVNyzjho=; b=Qp77h6hTjUVydB0/HRezSd0haTZSO 1iYq8IiDGuW4ikV5/7f2GdjlV6CyFTUNyhjrZLYi+tEu+wk9X4/ZKmhGq1aGwnr8 GeXlhLxvGWJVKw8v6YkzrWBgDNOlG27zqRKl1DI+nhwh7QLBIjLkFwllh39Czp0D hPytyV/e7iBRR60A9H8kEdm4BzFKq5z62OVKsgKsYapf59WDbfGiaohbsjDRfUWH A6SfZqxH1yWUdYLoo8j6A55J1ihnMIDPAvRhzBw4RTd47mMASu9itoZcsr/3310v UAuNDf8JS+QLeEXzboXrZ7BBggE1/Zy2lHVsgKx4FW8QfhOokBkBr7wdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=l5QoLWgfPvfguR2DrcmcTAqfnn8C69HIG2XMVNyzjho=; b=J6bTOXvF zinC8ieTJ/6xHJE7Yb7uRYhJIu47Gic6y8gJAUtISYrFcbNr6BhosxqagXvVpKQ9 vFodS4bH8oL7KuzGso7Xnj9lbw418/r5o0MoHK1XgFndRud6HtrVD9z5jqJDE8OF hLfGHxZqu+eRWsKWM9cfsXmE4R/qoyiCcfbjwluKD6wNXmXNtBas5EYunWqxOXvI iV1l0g4ok2vnne6wNT6gb9BlJvpnHGkJo/pQPruT6UJsiDlWa26p8yCDraOOZQCi 0ARs0z6XPnOSACvSyFcUGJlTqWfH4vRoCRDD4B9XGt6FJM7pxDcX+6gegh+miMyg BgnxAD7A6Pz63g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduuddguddvkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepgghinhgt vghnthcuuegvrhhnrghtuceovhhinhgtvghnthessggvrhhnrghtrdgthheqnecuggftrf grthhtvghrnhepieefjeeuieeggeehkeettdeltdehffffjeehtdehlefhtdffteegleeg geduhfejnecukfhppeekiedrvdegvddrkedrudeijeenucevlhhushhtvghrufhiiigvpe dunecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgrtheslhhufhhfhidrtgig X-ME-Proxy: Received: from neo.luffy.cx (lfbn-idf1-1-619-167.w86-242.abo.wanadoo.fr [86.242.8.167]) by mail.messagingengine.com (Postfix) with ESMTPA id C61703280414; Sat, 7 Nov 2020 14:35:32 -0500 (EST) Received: by neo.luffy.cx (Postfix, from userid 500) id B6D3EA17; Sat, 7 Nov 2020 20:35:31 +0100 (CET) From: Vincent Bernat To: "David S. Miller" , Jakub Kicinski , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, Jonathan Corbet Cc: Vincent Bernat Subject: [PATCH net-next v2 2/3] net: evaluate net.ipv4.conf.all.proxy_arp_pvlan Date: Sat, 7 Nov 2020 20:35:14 +0100 Message-Id: <20201107193515.1469030-3-vincent@bernat.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201107193515.1469030-1-vincent@bernat.ch> References: <20201107193515.1469030-1-vincent@bernat.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Introduced in 65324144b50b, the "proxy_arp_vlan" sysctl is a per-interface sysctl to tune proxy ARP support for private VLANs. While the "all" variant is exposed, it was a noop and never evaluated. We use the usual "or" logic for this kind of sysctls. Fixes: 65324144b50b ("net: RFC3069, private VLAN proxy arp support") Signed-off-by: Vincent Bernat Acked-by: Jesper Dangaard Brouer --- include/linux/inetdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 3bbcddd22df8..53aa0343bf69 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -105,7 +105,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) #define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) -#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN) +#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP_PVLAN) #define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) #define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) #define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ From patchwork Sat Nov 7 19:35:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Bernat X-Patchwork-Id: 1396224 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=bernat.ch Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bernat.ch header.i=@bernat.ch header.a=rsa-sha256 header.s=fm1 header.b=pYWBA6Ip; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=FYPh7TCM; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CT6tV2L3Sz9sVC for ; Sun, 8 Nov 2020 06:35:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728706AbgKGTfl (ORCPT ); Sat, 7 Nov 2020 14:35:41 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:39979 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726206AbgKGTfe (ORCPT ); Sat, 7 Nov 2020 14:35:34 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id A511ED19; Sat, 7 Nov 2020 14:35:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 07 Nov 2020 14:35:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bernat.ch; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=6/hoxChDQQHHb F/sCHpLtlxigecF0MmA0hHa1O2awHM=; b=pYWBA6Ip1bO9L1Y91lhEWzIU0vlys lvYtQOJ6CPXmm2y4FURR5yQWwFTBdJd/8kJsVY82XNHnJIc82GBg6uVDhN3jPpsk rdOSDADoQ9c/W0QzldnFLVtlAoZeyOLfRq+VgAj2WkM3790ACQo9fbpv751qpPBf Wp9rQbV+cQtk5LxdqVYLGx1t5Wu2p2j48x8ojixwKkmuMYJQTS85XC6y9gWz0/OT PMLm26oG9yviIIj6SsyVuGEgInl/PZDZvz1VoFlKuJLVvBj9ZE7hOawP5FMkZLQL juAw4IzKysLC20uM+10OkW02pe8Vx5FgtenYKHxy2kg2ViHy5Z80Ly7ow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=6/hoxChDQQHHbF/sCHpLtlxigecF0MmA0hHa1O2awHM=; b=FYPh7TCM ew8CVTIDXoQ7FYWNZPeOy7CTi7zguxlCz8T8JDJ06xszjdmuPZenQtY6U7Ks0UC4 zMeMTnI5R8M6+wGAOGKi7xniHXVkelmEuulG6aQvyjBZOtRosnIDbcF58AhwCF+/ 02SR6qTHqpB5Xrmr7i43tR8qsqL9eIOf6wIUphH8/OTLJU2yLg+UnwOHi57tS+bp EbfYCuqDBQZ0MvZCJuuOG1dtxQu3zzCCfVRcMT+i0MepkLHiarvnmV6kecV5g4ZQ LxOtBr85pMx2vkUenVMkO1W56SCydmmPFxoVVF7gZgfSZ/zC6uFZ4k5jA+W4Zqxe q6I3R8irw0645w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduuddguddvkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepgghinhgt vghnthcuuegvrhhnrghtuceovhhinhgtvghnthessggvrhhnrghtrdgthheqnecuggftrf grthhtvghrnhepieefjeeuieeggeehkeettdeltdehffffjeehtdehlefhtdffteegleeg geduhfejnecukfhppeekiedrvdegvddrkedrudeijeenucevlhhushhtvghrufhiiigvpe dunecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghrnhgrtheslhhufhhfhidrtgig X-ME-Proxy: Received: from neo.luffy.cx (lfbn-idf1-1-619-167.w86-242.abo.wanadoo.fr [86.242.8.167]) by mail.messagingengine.com (Postfix) with ESMTPA id 1A007328041B; Sat, 7 Nov 2020 14:35:33 -0500 (EST) Received: by neo.luffy.cx (Postfix, from userid 500) id 5C35D2341; Sat, 7 Nov 2020 20:35:32 +0100 (CET) From: Vincent Bernat To: "David S. Miller" , Jakub Kicinski , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, Jonathan Corbet Cc: Vincent Bernat Subject: [PATCH net-next v2 3/3] net: evaluate net.ipvX.conf.all.disable_policy and disable_xfrm Date: Sat, 7 Nov 2020 20:35:15 +0100 Message-Id: <20201107193515.1469030-4-vincent@bernat.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201107193515.1469030-1-vincent@bernat.ch> References: <20201107193515.1469030-1-vincent@bernat.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The disable_policy and disable_xfrm are a per-interface sysctl to disable IPsec policy or encryption on an interface. However, while a "all" variant is exposed, it was a noop since it was never evaluated. We use the usual "or" logic for this kind of sysctls. Signed-off-by: Vincent Bernat --- net/ipv4/route.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index dc2a399cd9f4..a3b60c41cbad 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1741,7 +1741,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, flags |= RTCF_LOCAL; rth = rt_dst_alloc(dev_net(dev)->loopback_dev, flags, RTN_MULTICAST, - IN_DEV_CONF_GET(in_dev, NOPOLICY), false); + IN_DEV_ORCONF(in_dev, NOPOLICY), false); if (!rth) return -ENOBUFS; @@ -1857,8 +1857,8 @@ static int __mkroute_input(struct sk_buff *skb, } rth = rt_dst_alloc(out_dev->dev, 0, res->type, - IN_DEV_CONF_GET(in_dev, NOPOLICY), - IN_DEV_CONF_GET(out_dev, NOXFRM)); + IN_DEV_ORCONF(in_dev, NOPOLICY), + IN_DEV_ORCONF(out_dev, NOXFRM)); if (!rth) { err = -ENOBUFS; goto cleanup; @@ -2227,7 +2227,7 @@ out: return err; rth = rt_dst_alloc(l3mdev_master_dev_rcu(dev) ? : net->loopback_dev, flags | RTCF_LOCAL, res->type, - IN_DEV_CONF_GET(in_dev, NOPOLICY), false); + IN_DEV_ORCONF(in_dev, NOPOLICY), false); if (!rth) goto e_nobufs; @@ -2450,8 +2450,8 @@ static struct rtable *__mkroute_output(const struct fib_result *res, add: rth = rt_dst_alloc(dev_out, flags, type, - IN_DEV_CONF_GET(in_dev, NOPOLICY), - IN_DEV_CONF_GET(in_dev, NOXFRM)); + IN_DEV_ORCONF(in_dev, NOPOLICY), + IN_DEV_ORCONF(in_dev, NOXFRM)); if (!rth) return ERR_PTR(-ENOBUFS);