rename Generic to GenericLink and add missing macvtap

This commit is contained in:
Vishvananda Ishaya 2015-08-18 03:16:06 -07:00
parent b8d3e51d2a
commit 6d78150380
2 changed files with 6 additions and 6 deletions

View File

@ -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
} }

View File

@ -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)
} }
} }