mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: remove cilium as a dependency unless built with --define=gotags=xdp
XDP isn't currently being used or developed, so it's best to reduce external dependencies. PiperOrigin-RevId: 678786045
This commit is contained in:
committed by
gVisor bot
parent
2d0a6f7865
commit
90faaeb34f
@@ -11,6 +11,7 @@ go_library(
|
||||
"memory.go",
|
||||
"network.go",
|
||||
"network_unsafe.go",
|
||||
"no_xdp.go",
|
||||
"sandbox.go",
|
||||
"sandbox_impl.go",
|
||||
"xdp.go",
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright 2024 The gVisor Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !xdp
|
||||
// +build !xdp
|
||||
|
||||
package sandbox
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/urpc"
|
||||
"gvisor.dev/gvisor/runsc/config"
|
||||
)
|
||||
|
||||
// This file holds placeholders for XDP support, which is not compiled in by default.
|
||||
//
|
||||
// To enable XDP support, build gVisor with `--define=gotags=xdp`.
|
||||
|
||||
const noXDPMsg = "XDP support was not built into this release -- rebuild with --define=gotags=xdp"
|
||||
|
||||
func createRedirectInterfacesAndRoutes(conn *urpc.Client, conf *config.Config) error {
|
||||
return errors.New(noXDPMsg)
|
||||
}
|
||||
|
||||
func createSocketXDP(iface net.Interface) ([]*os.File, error) {
|
||||
return nil, errors.New(noXDPMsg)
|
||||
}
|
||||
|
||||
func createXDPTunnel(conn *urpc.Client, nsPath string, conf *config.Config) error {
|
||||
return errors.New(noXDPMsg)
|
||||
}
|
||||
@@ -12,6 +12,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build xdp
|
||||
// +build xdp
|
||||
|
||||
package sandbox
|
||||
|
||||
import (
|
||||
@@ -34,6 +37,10 @@ import (
|
||||
xdpcmd "gvisor.dev/gvisor/tools/xdp/cmd"
|
||||
)
|
||||
|
||||
// This file supports XDP in gVisor. It is not compiled in by default.
|
||||
//
|
||||
// To enable XDP support, build gVisor with `--define=gotags=xdp`.
|
||||
|
||||
// createRedirectInterfacesAndRoutes initializes the network using an AF_XDP
|
||||
// socket on a *host* device, not a device in the container netns. It:
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user