Skip to contentSkip to conversation

netfilter: xt_physdev: Fix spurious error message in physdev_mt_check

PATCH Applied Todd Seidelmann 3 participants 3 messages Aug 21, 2019 – Aug 27, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: xt_physdev: Fix spurious error message in physdev_mt_check

Simplify the check in physdev_mt_check() to emit an error message only when passed an invalid chain (ie, NF_INET_LOCAL_OUT). This avoids cluttering up the log with errors against valid rules.

For large/heavily modified rulesets, current behavior can quickly overwhelm the ring buffer, because this function gets called on every change, regardless of the rule that was changed.

---

 net/netfilter/xt_physdev.c | 6 ++----

 1 file changed, 2 insertions(+), 4 deletions(-)
net/netfilter/xt_physdev.c +0 -0
index ead7c6022208..b92b22ce8abd 100644
@@ -101,11 +101,9 @@ static int physdev_mt_check(const struct xt_mtchk_param *par)

        if (info->bitmask & (XT_PHYSDEV_OP_OUT | XT_PHYSDEV_OP_ISOUT) &&
            (!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) ||
             info->invert & XT_PHYSDEV_OP_BRIDGED) &&
-           par->hook_mask & ((1 << NF_INET_LOCAL_OUT) |
-           (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) {
+           par->hook_mask & (1 << NF_INET_LOCAL_OUT)) {
                pr_info_ratelimited("--physdev-out and --physdev-is-out only supported in the FORWARD and POSTROUTING chains with bridged traffic\n"); -               if (par->hook_mask & (1 << NF_INET_LOCAL_OUT))
-                       return -EINVAL;
+               return -EINVAL;
        }

        if (!brnf_probed) {
--
2.17.1

maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Todd Seidelmann

Simplify the check in physdev_mt_check() to emit an error message only when passed an invalid chain (ie, NF_INET_LOCAL_OUT). This avoids cluttering up the log with errors against valid rules.

For large/heavily modified rulesets, current behavior can quickly overwhelm the ring buffer, because this function gets called on every change, regardless of the rule that was changed.

Agreed, we've had this notice long enough, better to only print it when we reject the rule.

maintainer Applied
#2 lore raw
In reply to Todd Seidelmann
Quoted 7 lines · Todd Seidelmann

Simplify the check in physdev_mt_check() to emit an error message only when passed an invalid chain (ie, NF_INET_LOCAL_OUT). This avoids cluttering up the log with errors against valid rules.

For large/heavily modified rulesets, current behavior can quickly overwhelm the ring buffer, because this function gets called on every change, regardless of the rule that was changed.

Applied, comment below.

net/netfilter/xt_physdev.c static int physdev_mt_check(const struct xt_mtchk_param · line 101

Quoted 9 lines

 net/netfilter/xt_physdev.c | 6 ++----

 1 file changed, 2 insertions(+), 4 deletions(-)
net/netfilter/xt_physdev.c +0 -0
index ead7c6022208..b92b22ce8abd 100644
@@ -101,11 +101,9 @@ static int physdev_mt_check(const struct xt_mtchk_param
 *par)

Please, fix your MUA, patch is mangled, I have fixed it here this time, this was not applying via git-am.