netfilter: physdev: physdev-is-out should not work with OUTPUT chain
Subsystems (2)
PATCH 1/1 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.
--- net/netfilter/xt_physdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/netfilter/xt_physdev.c +4 -4
@@ -102,14 +102,14 @@ static int physdev_mt_check(const struct xt_mtchk_param *par)if (!(info->bitmask &XT_PHYSDEV_OP_MASK ) || info->bitmask & ~XT_PHYSDEV_OP_MASK )return -EINVAL ; -if (info->bitmask &XT_PHYSDEV_OP_OUT && +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 ))) { -pr_info ("using --physdev-out in the OUTPUT, FORWARD and " -"POSTROUTING chains for non-bridged traffic is not " -"supported anymore.\n" ); +pr_info ("using --physdev-out and --physdev-is-out are only" +"supported in the FORWARD and POSTROUTING chains with" +"bridged traffic.\n" );if (par->hook_mask & (1 <<NF_INET_LOCAL_OUT ))return -EINVAL ; }
Signature · 1 line
2.5.5
Quoted 7 lines · Hangbin Liu
physdev_mt()will checkskb->nf_bridgefirst, which was alloced inbr_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 <[email protected]>
Quoted 35 lines
--- net/netfilter/xt_physdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)net/netfilter/xt_physdev.c +4
-4@@ -102,14 +102,14 @@ static int physdev_mt_check(const struct xt_mtchk_param *par)if (!(info->bitmask &XT_PHYSDEV_OP_MASK ) || info->bitmask & ~XT_PHYSDEV_OP_MASK )return -EINVAL ; -if (info->bitmask &XT_PHYSDEV_OP_OUT && +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 ))) { -pr_info ("using --physdev-out in the OUTPUT, FORWARD and " -"POSTROUTING chains for non-bridged traffic is not " -"supported anymore.\n" ); +pr_info ("using --physdev-out and --physdev-is-out are only" +"supported in the FORWARD and POSTROUTING chains with" +"bridged traffic.\n" );if (par->hook_mask & (1 <<NF_INET_LOCAL_OUT ))return -EINVAL ; }Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Marcelo Ricardo Leitner
Quoted 7 lines · Hangbin Liu
physdev_mt()will checkskb->nf_bridgefirst, which was alloced inbr_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 <[email protected]>Reviewed-by Marcelo R Leitner <[email protected]>
Applied, thanks.
Pablo Neira Ayuso
maintainerQuoted 8 lines · Pablo Neira Ayuso
Quoted 7 lines · Marcelo Ricardo Leitner
Quoted 6 lines · Hangbin Liu
physdev_mt()will checkskb->nf_bridgefirst, which was alloced inbr_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.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Hangbin Liu <[email protected]>Reviewed-by Marcelo R Leitner <[email protected]>Applied, thanks.
I have a batch ready for David now, so will be placing this in the next batch actually.
Don't worry if you don't see this in the next pull request I'm going to send.