Update go version (#603)

Removed ioctl code and remove exception from lint action
This commit is contained in:
Maycon Santos
2022-12-04 13:22:21 +01:00
committed by GitHub
parent d029136d3d
commit d2d5d4b4b9
14 changed files with 22 additions and 30 deletions

View File

@ -2,9 +2,9 @@ package routemanager
import (
"github.com/vishvananda/netlink"
"io/ioutil"
"net"
"net/netip"
"os"
)
const ipv4ForwardingPath = "/proc/sys/net/ipv4/ip_forward"
@ -59,12 +59,12 @@ func removeFromRouteTable(prefix netip.Prefix) error {
}
func enableIPForwarding() error {
err := ioutil.WriteFile(ipv4ForwardingPath, []byte("1"), 0644)
err := os.WriteFile(ipv4ForwardingPath, []byte("1"), 0644)
return err
}
func isNetForwardHistoryEnabled() bool {
out, err := ioutil.ReadFile(ipv4ForwardingPath)
out, err := os.ReadFile(ipv4ForwardingPath)
if err != nil {
// todo
panic(err)