aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorHangbin Liu <liuhangbin@gmail.com>2016-07-05 08:55:36 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2016-07-11 06:16:01 -0400
commit47c74456257d2e50ace8c473d358cf4b9c0a912f (patch)
tree518b1a2fc76e0f69d2925bdae5066120aa343aae /net/netfilter
parent870190a9ec9075205c0fa795a09fa931694a3ff1 (diff)
netfilter: physdev: physdev-is-out should not work with OUTPUT chain
physdev_mt() will check skb->nf_bridge first, which was alloced in br_nf_pre_routing. So if we want to use --physdev-out and physdev-is-out, we need to match it in FORWARD or POSTROUTING chain. physdev_mt_check() only checked physdev-out and missed physdev-is-out. Fix it and update the debug message to make it clearer. Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Reviewed-by: Marcelo R Leitner <marcelo.leitner@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/xt_physdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index 1caaccbc306c..e5f18988aee0 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -102,14 +102,14 @@ static int physdev_mt_check(const struct xt_mtchk_param *par)
102 if (!(info->bitmask & XT_PHYSDEV_OP_MASK) || 102 if (!(info->bitmask & XT_PHYSDEV_OP_MASK) ||
103 info->bitmask & ~XT_PHYSDEV_OP_MASK) 103 info->bitmask & ~XT_PHYSDEV_OP_MASK)
104 return -EINVAL; 104 return -EINVAL;
105 if (info->bitmask & XT_PHYSDEV_OP_OUT && 105 if (info->bitmask & (XT_PHYSDEV_OP_OUT | XT_PHYSDEV_OP_ISOUT) &&
106 (!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) || 106 (!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) ||
107 info->invert & XT_PHYSDEV_OP_BRIDGED) && 107 info->invert & XT_PHYSDEV_OP_BRIDGED) &&
108 par->hook_mask & ((1 << NF_INET_LOCAL_OUT) | 108 par->hook_mask & ((1 << NF_INET_LOCAL_OUT) |
109 (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) { 109 (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) {
110 pr_info("using --physdev-out in the OUTPUT, FORWARD and " 110 pr_info("using --physdev-out and --physdev-is-out are only"
111 "POSTROUTING chains for non-bridged traffic is not " 111 "supported in the FORWARD and POSTROUTING chains with"
112 "supported anymore.\n"); 112 "bridged traffic.\n");
113 if (par->hook_mask & (1 << NF_INET_LOCAL_OUT)) 113 if (par->hook_mask & (1 << NF_INET_LOCAL_OUT))
114 return -EINVAL; 114 return -EINVAL;
115 } 115 }