Bump all vendoring (#1612)

Update all vendoring to current releases.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2020-02-18 13:27:11 +01:00 committed by GitHub
commit 1567cefdae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
511 changed files with 98653 additions and 38115 deletions

View file

@ -111,13 +111,8 @@ func (f *Family) parseAttributes(b []byte) error {
f.Version = uint8(v)
case unix.CTRL_ATTR_MCAST_GROUPS:
ad.Do(func(b []byte) error {
groups, err := parseMulticastGroups(b)
if err != nil {
return err
}
f.Groups = groups
ad.Nested(func(nad *netlink.AttributeDecoder) error {
f.Groups = parseMulticastGroups(nad)
return nil
})
}
@ -128,42 +123,24 @@ func (f *Family) parseAttributes(b []byte) error {
// parseMulticastGroups parses an array of multicast group nested attributes
// into a slice of MulticastGroups.
func parseMulticastGroups(b []byte) ([]MulticastGroup, error) {
ad, err := netlink.NewAttributeDecoder(b)
if err != nil {
return nil, err
}
var groups []MulticastGroup
func parseMulticastGroups(ad *netlink.AttributeDecoder) []MulticastGroup {
groups := make([]MulticastGroup, 0, ad.Len())
for ad.Next() {
ad.Do(func(b []byte) error {
adi, err := netlink.NewAttributeDecoder(b)
if err != nil {
return err
}
ad.Nested(func(nad *netlink.AttributeDecoder) error {
var g MulticastGroup
for adi.Next() {
switch adi.Type() {
for nad.Next() {
switch nad.Type() {
case unix.CTRL_ATTR_MCAST_GRP_NAME:
g.Name = adi.String()
g.Name = nad.String()
case unix.CTRL_ATTR_MCAST_GRP_ID:
g.ID = adi.Uint32()
g.ID = nad.Uint32()
}
}
if err := ad.Err(); err != nil {
return err
}
groups = append(groups, g)
return nil
})
}
if err := ad.Err(); err != nil {
return nil, err
}
return groups, nil
return groups
}