1

netfilter: nfnetlink_log: use proper helper for fetching physinif

We don't use physindev in __build_packet_message except for getting
physinif from it. So let's switch to nf_bridge_get_physinif to get what
we want directly.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Pavel Tikhomirov 2024-01-11 23:06:37 +08:00 committed by Pablo Neira Ayuso
parent 91a139cee1
commit c3f9fd54cd

View File

@ -508,7 +508,7 @@ __build_packet_message(struct nfnl_log_net *log,
htonl(br_port_get_rcu(indev)->br->dev->ifindex))) htonl(br_port_get_rcu(indev)->br->dev->ifindex)))
goto nla_put_failure; goto nla_put_failure;
} else { } else {
struct net_device *physindev; int physinif;
/* Case 2: indev is bridge group, we need to look for /* Case 2: indev is bridge group, we need to look for
* physical device (when called from ipv4) */ * physical device (when called from ipv4) */
@ -516,10 +516,10 @@ __build_packet_message(struct nfnl_log_net *log,
htonl(indev->ifindex))) htonl(indev->ifindex)))
goto nla_put_failure; goto nla_put_failure;
physindev = nf_bridge_get_physindev(skb); physinif = nf_bridge_get_physinif(skb);
if (physindev && if (physinif &&
nla_put_be32(inst->skb, NFULA_IFINDEX_PHYSINDEV, nla_put_be32(inst->skb, NFULA_IFINDEX_PHYSINDEV,
htonl(physindev->ifindex))) htonl(physinif)))
goto nla_put_failure; goto nla_put_failure;
} }
#endif #endif