Skip to content

Commit

Permalink
Fix networking structures after version bump
Browse files Browse the repository at this point in the history
Signed-off-by: Leonid Kondrashov <[email protected]>
  • Loading branch information
leokondrashov committed Aug 23, 2024
1 parent 63854e5 commit 99552be
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions networking/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ import (
"bufio"
"bytes"
"fmt"
"net"
"os"
"os/exec"
"regexp"
"strconv"
"strings"

"github.com/google/nftables"
"github.com/google/nftables/expr"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
"golang.org/x/sys/unix"
"net"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
)

// getHostIfaceName returns the default host network interface name.
Expand Down Expand Up @@ -201,7 +202,7 @@ func setupNatRules(vethVmName, hostIp, cloneIp string, vmNsHandle netns.NsHandle
Name: "POSTROUTING",
Table: natTable,
Type: nftables.ChainTypeNAT,
Priority: 0,
Priority: nftables.ChainPriorityRef(0),
Hooknum: nftables.ChainHookPostrouting,
Policy: &polAccept,
}
Expand Down Expand Up @@ -251,7 +252,7 @@ func setupNatRules(vethVmName, hostIp, cloneIp string, vmNsHandle netns.NsHandle
Name: "PREROUTING",
Table: natTable,
Type: nftables.ChainTypeNAT,
Priority: 0,
Priority: nftables.ChainPriorityRef(0),
Hooknum: nftables.ChainHookPrerouting,
Policy: &polAccept,
}
Expand Down Expand Up @@ -340,7 +341,7 @@ func setupForwardRules(vethHostName, hostIface string) error {
Name: fmt.Sprintf("FORWARD%s", vethHostName),
Table: filterTable,
Type: nftables.ChainTypeFilter,
Priority: 0,
Priority: nftables.ChainPriorityRef(0),
Hooknum: nftables.ChainHookForward,
Policy: &polAccept,
}
Expand Down Expand Up @@ -427,7 +428,7 @@ func deleteForwardRules(vethHostName string) error {
Name: fmt.Sprintf("FORWARD%s", vethHostName),
Table: filterTable,
Type: nftables.ChainTypeFilter,
Priority: 0,
Priority: nftables.ChainPriorityRef(0),
Hooknum: nftables.ChainHookForward,
Policy: &polAccept,
}
Expand Down

0 comments on commit 99552be

Please sign in to comment.