Skip to content

Commit d420f5b

Browse files
committed
Fix: we were checking if the NIC had a parent and executing bridge logic, changed to check if it's a bridged parent
Signed-off-by: NathanChase22 <[email protected]>
1 parent 003c227 commit d420f5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/server/device/nic_physical.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func (d *nicPhysical) Start() (*deviceConfig.RunConfig, error) {
198198
return nil, fmt.Errorf("Missing parent device name")
199199
}
200200

201-
isParentBridge := util.PathExists(fmt.Sprintf("/sys/class/net/%s", d.config["parent"]))
201+
isParentBridge := util.PathExists(fmt.Sprintf("/sys/class/net/%s/bridge", d.config["parent"]))
202202
if isParentBridge {
203203
bridgedConfig := d.config.Clone()
204204
bridgedConfig["type"] = "nic"
@@ -419,7 +419,7 @@ func (d *nicPhysical) startVMUSB(name string) (*deviceConfig.RunConfig, error) {
419419

420420
// Stop is run when the device is removed from the instance.
421421
func (d *nicPhysical) Stop() (*deviceConfig.RunConfig, error) {
422-
isParentBridge := util.PathExists(fmt.Sprintf("/sys/class/net/%s", d.config["parent"]))
422+
isParentBridge := util.PathExists(fmt.Sprintf("/sys/class/net/%s/bridge", d.config["parent"]))
423423
if isParentBridge {
424424
bridgedConfig := d.config.Clone()
425425
bridgedConfig["type"] = "nic"

0 commit comments

Comments
 (0)