mirror of https://github.com/vishvananda/netlink
rename Generic to GenericLink and add missing macvtap
This commit is contained in:
parent
b8d3e51d2a
commit
6d78150380
8
link.go
8
link.go
|
@ -137,18 +137,18 @@ func (veth *Veth) Type() string {
|
|||
return "veth"
|
||||
}
|
||||
|
||||
// Generic links represent types that are not currently understood
|
||||
// GenericLink links represent types that are not currently understood
|
||||
// by this netlink library.
|
||||
type Generic struct {
|
||||
type GenericLink struct {
|
||||
LinkAttrs
|
||||
LinkType string
|
||||
}
|
||||
|
||||
func (generic *Generic) Attrs() *LinkAttrs {
|
||||
func (generic *GenericLink) Attrs() *LinkAttrs {
|
||||
return &generic.LinkAttrs
|
||||
}
|
||||
|
||||
func (generic *Generic) Type() string {
|
||||
func (generic *GenericLink) Type() string {
|
||||
return generic.LinkType
|
||||
}
|
||||
|
||||
|
|
|
@ -508,7 +508,7 @@ func linkDeserialize(m []byte) (Link, error) {
|
|||
case "macvtap":
|
||||
link = &Macvtap{}
|
||||
default:
|
||||
link = &Generic{LinkType: linkType}
|
||||
link = &GenericLink{LinkType: linkType}
|
||||
}
|
||||
case nl.IFLA_INFO_DATA:
|
||||
data, err := nl.ParseRouteAttr(info.Value)
|
||||
|
@ -522,7 +522,7 @@ func linkDeserialize(m []byte) (Link, error) {
|
|||
parseVxlanData(link, data)
|
||||
case "ipvlan":
|
||||
parseIPVlanData(link, data)
|
||||
case "macvlan":
|
||||
case "macvlan", "macvtap":
|
||||
parseMacvlanData(link, data)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue