Skip to content

Commit

Permalink
Merge pull request #873 from maiqueb/mac-spoof-remove-index-when-addi…
Browse files Browse the repository at this point in the history
…ng-rules

bridge, spoof check: remove drop rule index
  • Loading branch information
squeed committed Apr 17, 2023
2 parents 4a6147a + cac8230 commit 71aa710
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions pkg/link/spoofcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,10 @@ func (sc *SpoofChecker) matchMacRule(chain string) *schema.Rule {
}

func (sc *SpoofChecker) dropRule(chain string) *schema.Rule {
macRulesIndex := nft.NewRuleIndex()
return &schema.Rule{
Family: schema.FamilyBridge,
Table: natTableName,
Chain: chain,
Index: macRulesIndex.Next(),
Expr: []schema.Statement{
{Verdict: schema.Verdict{SimpleVerdict: schema.SimpleVerdict{Drop: true}}},
},
Expand Down
1 change: 0 additions & 1 deletion pkg/link/spoofcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ func assertExpectedRulesInSetupConfig(c configurerStub) {
"comment":"macspoofchk-container99-net1"}},
{"rule":{"family":"bridge","table":"nat","chain":"cni-br-iface-container99-net1-mac",
"expr":[{"drop":null}],
"index":0,
"comment":"macspoofchk-container99-net1"}}
]}`
ExpectWithOffset(1, string(jsonConfig)).To(MatchJSON(expectedConfig))
Expand Down

0 comments on commit 71aa710

Please sign in to comment.