Skip generate nftables output chain if lo in excluded interface list
This commit is contained in:
parent
85f5f2dd58
commit
1048b277ea
1 changed files with 35 additions and 32 deletions
|
|
@ -42,6 +42,8 @@ func (r *autoRedirect) setupNFTables() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skipOutput := len(r.tunOptions.IncludeInterface) > 0 && !common.Contains(r.tunOptions.IncludeInterface, "lo") || common.Contains(r.tunOptions.ExcludeInterface, "lo")
|
||||||
|
if !skipOutput {
|
||||||
chainOutput := nft.AddChain(&nftables.Chain{
|
chainOutput := nft.AddChain(&nftables.Chain{
|
||||||
Name: "output",
|
Name: "output",
|
||||||
Table: table,
|
Table: table,
|
||||||
|
|
@ -80,6 +82,7 @@ func (r *autoRedirect) setupNFTables() error {
|
||||||
Data: nftablesIfname(r.tunOptions.Name),
|
Data: nftablesIfname(r.tunOptions.Name),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
chainPreRouting := nft.AddChain(&nftables.Chain{
|
chainPreRouting := nft.AddChain(&nftables.Chain{
|
||||||
Name: "prerouting",
|
Name: "prerouting",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue