MCPcopy
hub / github.com/lxc/incus / BridgeVLANSetDefaultPVID

Function BridgeVLANSetDefaultPVID

internal/server/network/network_utils_bridge.go:45–52  ·  view source on GitHub ↗

BridgeVLANSetDefaultPVID sets the VLAN default port VLAN ID (PVID).

(interfaceName string, vlanID string)

Source from the content-addressed store, hash-verified

43
44// BridgeVLANSetDefaultPVID sets the VLAN default port VLAN ID (PVID).
45func BridgeVLANSetDefaultPVID(interfaceName string, vlanID string) error {
46 err := os.WriteFile(fmt.Sprintf("/sys/class/net/%s/bridge/default_pvid", interfaceName), []byte(vlanID), 0)
47 if err != nil {
48 return fmt.Errorf("Failed setting bridge VLAN default PVID for %q: %w", interfaceName, err)
49 }
50
51 return nil
52}
53
54// IsNativeBridge returns whether the bridge name specified is a Linux native bridge.
55func IsNativeBridge(bridgeName string) bool {

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.80
WriteFileMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…