diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-06-30 16:31:00 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-06-30 16:31:00 -0700 |
commit | 0d8730f07c822a351a624462918c7109cdc7f402 (patch) | |
tree | 3539d4c7c098894f3b2d5f49134c8cfccc06aaca /net/bridge | |
parent | b7d78b46d5e8dc77c656c13885d31e931923b915 (diff) | |
parent | 5e8379351dbde61ea383e514f0f9ecb2c047cf4e (diff) | |
download | linux-stable-0d8730f07c822a351a624462918c7109cdc7f402.tar.gz linux-stable-0d8730f07c822a351a624462918c7109cdc7f402.tar.bz2 linux-stable-0d8730f07c822a351a624462918c7109cdc7f402.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c
9c5de246c1db ("net: sparx5: mdb add/del handle non-sparx5 devices")
fbb89d02e33a ("net: sparx5: Allow mdb entries to both CPU and ports")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_netfilter_hooks.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index 4fd882686b04..ff4779036649 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c @@ -1012,9 +1012,24 @@ int br_nf_hook_thresh(unsigned int hook, struct net *net, return okfn(net, sk, skb); ops = nf_hook_entries_get_hook_ops(e); - for (i = 0; i < e->num_hook_entries && - ops[i]->priority <= NF_BR_PRI_BRNF; i++) - ; + for (i = 0; i < e->num_hook_entries; i++) { + /* These hooks have already been called */ + if (ops[i]->priority < NF_BR_PRI_BRNF) + continue; + + /* These hooks have not been called yet, run them. */ + if (ops[i]->priority > NF_BR_PRI_BRNF) + break; + + /* take a closer look at NF_BR_PRI_BRNF. */ + if (ops[i]->hook == br_nf_pre_routing) { + /* This hook diverted the skb to this function, + * hooks after this have not been run yet. + */ + i++; + break; + } + } nf_hook_state_init(&state, hook, NFPROTO_BRIDGE, indev, outdev, sk, net, okfn); |