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"
|
return "veth"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generic links represent types that are not currently understood
|
// GenericLink links represent types that are not currently understood
|
||||||
// by this netlink library.
|
// by this netlink library.
|
||||||
type Generic struct {
|
type GenericLink struct {
|
||||||
LinkAttrs
|
LinkAttrs
|
||||||
LinkType string
|
LinkType string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (generic *Generic) Attrs() *LinkAttrs {
|
func (generic *GenericLink) Attrs() *LinkAttrs {
|
||||||
return &generic.LinkAttrs
|
return &generic.LinkAttrs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (generic *Generic) Type() string {
|
func (generic *GenericLink) Type() string {
|
||||||
return generic.LinkType
|
return generic.LinkType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -508,7 +508,7 @@ func linkDeserialize(m []byte) (Link, error) {
|
||||||
case "macvtap":
|
case "macvtap":
|
||||||
link = &Macvtap{}
|
link = &Macvtap{}
|
||||||
default:
|
default:
|
||||||
link = &Generic{LinkType: linkType}
|
link = &GenericLink{LinkType: linkType}
|
||||||
}
|
}
|
||||||
case nl.IFLA_INFO_DATA:
|
case nl.IFLA_INFO_DATA:
|
||||||
data, err := nl.ParseRouteAttr(info.Value)
|
data, err := nl.ParseRouteAttr(info.Value)
|
||||||
|
@ -522,7 +522,7 @@ func linkDeserialize(m []byte) (Link, error) {
|
||||||
parseVxlanData(link, data)
|
parseVxlanData(link, data)
|
||||||
case "ipvlan":
|
case "ipvlan":
|
||||||
parseIPVlanData(link, data)
|
parseIPVlanData(link, data)
|
||||||
case "macvlan":
|
case "macvlan", "macvtap":
|
||||||
parseMacvlanData(link, data)
|
parseMacvlanData(link, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue