mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 02:56:18 +00:00
virtcontainers: Rely on new interface LinkType field
Now that Interface structure includes the useful information about the type of interface, Kata does not need to do any assumption about the type of interface that needs to be added. Fixes #866 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
45b219107c
commit
51997775bd
@ -1098,13 +1098,6 @@ func (s *Sandbox) generateNetInfo(inf *types.Interface) (NetworkInfo, error) {
|
||||
addrs = append(addrs, *netlinkAddr)
|
||||
}
|
||||
|
||||
var ifaceType string
|
||||
if s.config.NetworkConfig.InterworkingModel == NetXConnectNoneModel {
|
||||
ifaceType = "tap"
|
||||
} else {
|
||||
ifaceType = "veth"
|
||||
}
|
||||
|
||||
return NetworkInfo{
|
||||
Iface: NetlinkIface{
|
||||
LinkAttrs: netlink.LinkAttrs{
|
||||
@ -1112,7 +1105,7 @@ func (s *Sandbox) generateNetInfo(inf *types.Interface) (NetworkInfo, error) {
|
||||
HardwareAddr: hw,
|
||||
MTU: int(inf.Mtu),
|
||||
},
|
||||
Type: ifaceType,
|
||||
Type: inf.LinkType,
|
||||
},
|
||||
Addrs: addrs,
|
||||
}, nil
|
||||
|
Loading…
Reference in New Issue
Block a user