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

Commit

Permalink
virtcontainers: Rely on new interface LinkType field
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Sebastien Boeuf committed Nov 2, 2018
1 parent 45b2191 commit 5199777
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -1098,21 +1098,14 @@ 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{
Name: inf.Name,
HardwareAddr: hw,
MTU: int(inf.Mtu),
},
Type: ifaceType,
Type: inf.LinkType,
},
Addrs: addrs,
}, nil
Expand Down

0 comments on commit 5199777

Please sign in to comment.