Skip to content

Commit

Permalink
Fix linter issues and builds on macOS and Windows again
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsastrix committed Jun 2, 2024
1 parent 90934fa commit 09799d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions client/internal/routemanager/server_nonandroid.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ func (m *defaultServerRouter) cleanUp() {
routingAddress = m.wgInterface.Address6().Masked().String()
}
routerPair, err := routeToRouterPair(routingAddress, r)
if err != nil {
log.Errorf("parse prefix: %v", err)
}

err = m.firewall.RemoveRoutingRules(routerPair)
if err != nil {
Expand Down
6 changes: 6 additions & 0 deletions client/internal/routemanager/systemops_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ func addRoute(prefix netip.Prefix, addr netip.Addr, intf *net.Interface, tableID
// addUnreachableRoute adds an unreachable route for the specified IP family and routing table.
// ipFamily should be netlink.FAMILY_V4 for IPv4 or netlink.FAMILY_V6 for IPv6.
// tableID specifies the routing table to which the unreachable route will be added.
// TODO should this be kept in for future use? If so, the linter needs to be told that this unreachable function should
//
// be kept
func addUnreachableRoute(prefix netip.Prefix, tableID int) error {

Check failure on line 276 in client/internal/routemanager/systemops_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

func `addUnreachableRoute` is unused (unused)
_, ipNet, err := net.ParseCIDR(prefix.String())
if err != nil {
Expand All @@ -290,6 +293,9 @@ func addUnreachableRoute(prefix netip.Prefix, tableID int) error {
return nil
}

// TODO should this be kept in for future use? If so, the linter needs to be told that this unreachable function should
//
// be kept
func removeUnreachableRoute(prefix netip.Prefix, tableID int) error {

Check failure on line 299 in client/internal/routemanager/systemops_linux.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

func `removeUnreachableRoute` is unused (unused)
_, ipNet, err := net.ParseCIDR(prefix.String())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion client/internal/routemanager/systemops_nonlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
log "github.com/sirupsen/logrus"
)

func enableIPForwarding() error {
func enableIPForwarding(includeV6 bool) error {
log.Infof("Enable IP forwarding is not implemented on %s", runtime.GOOS)
return nil
}
Expand Down

0 comments on commit 09799d4

Please sign in to comment.