@@ -10,7 +10,6 @@ import (
1010
1111 "github.com/1Panel-dev/1Panel/backend/app/dto"
1212 "github.com/1Panel-dev/1Panel/backend/app/model"
13- "github.com/1Panel-dev/1Panel/backend/buserr"
1413 "github.com/1Panel-dev/1Panel/backend/constant"
1514 "github.com/1Panel-dev/1Panel/backend/global"
1615 "github.com/1Panel-dev/1Panel/backend/utils/cmd"
@@ -87,11 +86,6 @@ func (u *FirewallService) SearchWithPage(req dto.RuleSearch) (int64, interface{}
8786 case "port" :
8887 rules , err = client .ListPort ()
8988 case "forward" :
90- isSupport , errSup := checkIsSupport ()
91- if ! isSupport {
92- return 0 , nil , errSup
93- }
94-
9589 rules , err = client .ListForward ()
9690 case "address" :
9791 rules , err = client .ListAddress ()
@@ -312,11 +306,6 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool)
312306}
313307
314308func (u * FirewallService ) OperateForwardRule (req dto.ForwardRuleOperate ) error {
315- isSupport , errSup := checkIsSupport ()
316- if ! isSupport {
317- return errSup
318- }
319-
320309 client , err := firewall .NewFirewallClient ()
321310 if err != nil {
322311 return err
@@ -737,14 +726,3 @@ func checkPortUsed(ports, proto string, apps []portOfApp) string {
737726 }
738727 return ""
739728}
740-
741- func checkIsSupport () (bool , error ) {
742- std , err := cmd .Exec ("iptables --version" )
743- if err != nil {
744- return false , fmt .Errorf ("handle iptables --version failed, stdout: %s, err: %v" , std , err )
745- }
746- if strings .Contains (std , "nf_tables" ) {
747- return false , buserr .New (constant .ErrNFTables )
748- }
749- return true , nil
750- }
0 commit comments