Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1327038ybg; Wed, 29 Jul 2020 11:11:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW0Qf7oxkD6O67sqiJYFHJ/oVkENeYBXAMc7MqptZlsEza5l0bCctrgChngRsX7oYXdwHh X-Received: by 2002:a17:906:774d:: with SMTP id o13mr31034972ejn.373.1596046293701; Wed, 29 Jul 2020 11:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596046293; cv=none; d=google.com; s=arc-20160816; b=IhXR3SNQtNx8QHxDndQfRhsKJmJjQm1I39tXurtX5CtD/ft+vTT8bBv70VBSZheU80 83xmFRiapSUImxFbHSXXIYjSjPsj3pHr68YoXa7JojjRFnW2lAKJd+obeXnzVPMiOvaR NoCvLFZCKvqNZTv+X97P8qS4QK3lLciStITNlSkHv3GVI8wkCvMXFy9bD/haVWsK9JVL FNuQDsi6QVAmdo+XkJengzMrUzasqdS7x5IwrOsfyN83TLSx6w3hxKMWZzcSKOV5uRMf RSFGgPYFPFen21/ZrkCsLyaQNBL2q9oxy+MO3WH/LyLZNc/wk6JpRywM9oTenuCmV06+ 0XmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=NJgVNE3qVbUu930lPz5yhQZ0xcOIMGZyL4mDwfy0Ps4=; b=WkW9eFpbQKVM45BcnG5AXk++NZRVSs/v2bd6BR02SUZCz/vvaeX4nyAHJ5EL2gpbN/ N6Sinc27DkD/rQnEQci5Npaxr0PSvUGeSPC4dXRm8E6YgHeLSagDw2r+VzYWYUetz24r ioDAXZTHs6ZX64ySdC5PIyrvedesY56BXnapk1hqfMNCjpGxFnwO2eBH2QSYeLrLV/T/ 4pb9ZcYirjgweeO6EiLnggVfJrOIH/015tdlN2tf05KpWJS0G0okzz0iLdshk3uQhU4M rdDbaR1EyWHZ5UAasaQ/WlkDDSYdT+i9Is9rQPp7lGjOjtaOYr6Sp/2aSscbwp/uhMwD 4dqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TM3zDmSW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si1701562edi.143.2020.07.29.11.11.11; Wed, 29 Jul 2020 11:11:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TM3zDmSW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727064AbgG2SKY (ORCPT + 99 others); Wed, 29 Jul 2020 14:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbgG2SKX (ORCPT ); Wed, 29 Jul 2020 14:10:23 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44381C061794 for ; Wed, 29 Jul 2020 11:10:23 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id e135so30478564ybf.4 for ; Wed, 29 Jul 2020 11:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=NJgVNE3qVbUu930lPz5yhQZ0xcOIMGZyL4mDwfy0Ps4=; b=TM3zDmSWm8vlffvSbUJcRRTfjNm/WwHI4uolVELMqMw0iNnS/TFZZ0UefotLuKWrBx B+5U7uauClFTmtskmiAgyveFyZQCVdBgSIAPAv/3KthEd1nToAKkWJI5+vL7Q00aM1yF BHUnvrRbB2IOzwg2Sxq4JL8WuBboHb3I9j4F6lQxBwax+zCw0yUED/PO3zytqUqeiiEF JfVeyRKrEi8/VZDLoWseKBu4Kp2vbLgVBmUXlDDB1V8gzvNQrpdPni3vkSRK6Ppf8z5I R/IXM+FBvP+n6AwvQ31zKokfcZx6gyPbYsUMoIVNrMgp+x4cLfP6NPp75qN/cmQryJ9U Pe8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=NJgVNE3qVbUu930lPz5yhQZ0xcOIMGZyL4mDwfy0Ps4=; b=U16UJVOGz0GhiKTOMCN8nZNKHwbW8zNW9raMIy+Fqmz0GEs8UatIG1YckktXBhS+1F SsGA+kZwgDW2XwW1jXEL7tropSniqSZ+DfCKdmoXiJ6HEZMSJwizMXZN9Kxtec3e3MeZ exxRjlESlmY6EVOHSMn8Tq2eo2duww8iyvGPXKQWc2BvxToaWZgv8pQ089XdnHebmsQt 3I5yKUUCpU20EN1WkNVI8Fwyc7u+nLfHxnoBUR+60MCwWyHrbpn4GMSJt4FkZB6eBKH/ OtBVMURbPMajTy+s3C+8+5+4EPyMoeCFrFgui+pzzOrW1TeVyHEIEmRahRQjKulzerUJ 9ysw== X-Gm-Message-State: AOAM5311mHGK16axpYvpYNyYXNezpi2OtYqTCZQAZLTyNjyTIvrOC81r g0mnQJynjdhg4YoUoKH4GV0UVkdeR3AL X-Received: by 2002:a25:7006:: with SMTP id l6mr26693708ybc.197.1596046222464; Wed, 29 Jul 2020 11:10:22 -0700 (PDT) Date: Wed, 29 Jul 2020 11:10:18 -0700 Message-Id: <20200729181018.3221288-1-brianvv@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.rc0.142.g3c755180ce-goog Subject: [PATCH net-next] fib: fix fib_rules_ops indirect calls wrappers From: Brian Vazquez To: Brian Vazquez , Brian Vazquez , Eric Dumazet , Paolo Abeni , "David S . Miller" Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Stephen Rothwell Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes: commit b9aaec8f0be5 ("fib: use indirect call wrappers in the most common fib_rules_ops") which didn't consider the case when CONFIG_IPV6_MULTIPLE_TABLES is not set. Reported-by: Stephen Rothwell Fixes: b9aaec8f0be5 ("fib: use indirect call wrappers in the most common fib_rules_ops") Signed-off-by: Brian Vazquez --- net/core/fib_rules.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index e7a8f87b0bb2b..fce645f6b9b10 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -16,6 +16,13 @@ #include #include +#ifdef CONFIG_IPV6_MULTIPLE_TABLES +#define INDIRECT_CALL_MT(f, f2, f1, ...) \ + INDIRECT_CALL_INET(f, f2, f1, __VA_ARGS__) +#else +#define INDIRECT_CALL_MT(f, f2, f1, ...) INDIRECT_CALL_1(f, f1, __VA_ARGS__) +#endif + static const struct fib_kuid_range fib_kuid_range_unset = { KUIDT_INIT(0), KUIDT_INIT(~0), @@ -268,10 +275,10 @@ static int fib_rule_match(struct fib_rule *rule, struct fib_rules_ops *ops, uid_gt(fl->flowi_uid, rule->uid_range.end)) goto out; - ret = INDIRECT_CALL_INET(ops->match, - fib6_rule_match, - fib4_rule_match, - rule, fl, flags); + ret = INDIRECT_CALL_MT(ops->match, + fib6_rule_match, + fib4_rule_match, + rule, fl, flags); out: return (rule->flags & FIB_RULE_INVERT) ? !ret : ret; } @@ -302,15 +309,15 @@ int fib_rules_lookup(struct fib_rules_ops *ops, struct flowi *fl, } else if (rule->action == FR_ACT_NOP) continue; else - err = INDIRECT_CALL_INET(ops->action, - fib6_rule_action, - fib4_rule_action, - rule, fl, flags, arg); - - if (!err && ops->suppress && INDIRECT_CALL_INET(ops->suppress, - fib6_rule_suppress, - fib4_rule_suppress, - rule, arg)) + err = INDIRECT_CALL_MT(ops->action, + fib6_rule_action, + fib4_rule_action, + rule, fl, flags, arg); + + if (!err && ops->suppress && INDIRECT_CALL_MT(ops->suppress, + fib6_rule_suppress, + fib4_rule_suppress, + rule, arg)) continue; if (err != -EAGAIN) { -- 2.28.0.rc0.142.g3c755180ce-goog