fix: update error handling in Start methods for netlink, nfqueue, redirect, and tproxy servers to indicate Linux support only

This commit is contained in:
SunBK201 2025-11-13 21:46:23 +08:00
parent cd848165db
commit 9130e9c4f0
4 changed files with 10 additions and 6 deletions

View File

@ -3,6 +3,8 @@
package netlink
import (
"errors"
"github.com/sunbk201/ua3f/internal/config"
)
@ -22,7 +24,7 @@ func (s *Server) Setup() (err error) {
}
func (s *Server) Start() (err error) {
return nil
return errors.New("netlink helper is only supported on linux")
}
func (s *Server) Close() (err error) {

View File

@ -3,6 +3,8 @@
package nfqueue
import (
"errors"
"github.com/sunbk201/ua3f/internal/config"
"github.com/sunbk201/ua3f/internal/rewrite"
)
@ -25,7 +27,7 @@ func (s *Server) Setup() (err error) {
}
func (s *Server) Start() (err error) {
return nil
return errors.New("nfqueue server is only supported on linux")
}
func (s *Server) Close() (err error) {

View File

@ -3,7 +3,7 @@
package redirect
import (
"fmt"
"errors"
"net"
"github.com/sunbk201/ua3f/internal/config"
@ -24,7 +24,7 @@ func New(cfg *config.Config, rw *rewrite.Rewriter) *Server {
}
func (s *Server) Start() error {
return fmt.Errorf("REDIRECT Mode is only supported on Linux")
return errors.New("redirect server is only supported on linux")
}
func (s *Server) Close() error {

View File

@ -3,7 +3,7 @@
package tproxy
import (
"fmt"
"errors"
"net"
"github.com/sunbk201/ua3f/internal/config"
@ -24,7 +24,7 @@ func New(cfg *config.Config, rw *rewrite.Rewriter) *Server {
}
func (s *Server) Start() error {
return fmt.Errorf("TPROXY Mode is only supported on Linux")
return errors.New("tproxy server is only supported on linux")
}
func (s *Server) Close() error {