Skip to content

Commit

Permalink
Merge pull request #51 from GaoChX/main
Browse files Browse the repository at this point in the history
fix: delete specified ebtables chain.
  • Loading branch information
singchia authored Jan 7, 2025
2 parents a3fa599 + b1dc448 commit 4cf72fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ebtables/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,12 @@ type DeleteChain struct {
chainName string
}

func newDeleteChain() *DeleteChain {
func newDeleteChain(chainName string) *DeleteChain {
command := &DeleteChain{
baseCommand: &baseCommand{
commandType: CommandTypeDeleteChain,
},
chainName: chainName,
}
command.setChild(command)
return command
Expand Down
2 changes: 1 addition & 1 deletion ebtables/end.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (ebtables *EBTables) DeleteChain() error {

for _, table := range tables {
newebtables.Table(table)
command := newDeleteChain()
command := newDeleteChain(newebtables.statement.chain)
newebtables.statement.command = command
if newebtables.dr {
newebtables.dryrun()
Expand Down

0 comments on commit 4cf72fb

Please sign in to comment.