Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
network: Explicitly check for veth type
Browse files Browse the repository at this point in the history
Explicitly check for "veth" intergace type while creating a
veth endpoint. Error out for unsupported network interfaces.

Signed-off-by: Archana Shinde <[email protected]>
  • Loading branch information
amshinde committed Oct 11, 2018
1 parent 3c590b0 commit ab15498
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion virtcontainers/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,10 @@ func createEndpoint(netInfo NetworkInfo, idx int, model NetInterworkingModel) (E
} else if netInfo.Iface.Type == "macvtap" {
networkLogger().Infof("macvtap interface found")
endpoint, err = createMacvtapNetworkEndpoint(netInfo)
} else {
} else if netInfo.Iface.Type == "veth" {
endpoint, err = createVethNetworkEndpoint(idx, netInfo.Iface.Name, model)
} else {
return nil, fmt.Errorf("Unsupported network interface")
}
}

Expand Down

0 comments on commit ab15498

Please sign in to comment.