func (c *Conn) getFamily(name string) (Family, error) {
	b, err := netlink.MarshalAttributes([]netlink.Attribute{{
		Type: unix.CTRL_ATTR_FAMILY_NAME,
		Data: nlenc.Bytes(name),
	}})
	if err != nil {
		return Family{}, err
	}
	req := Message{
		Header: Header{
			Command: unix.CTRL_CMD_GETFAMILY,
			Version: 1,
		},
		Data: b,
	}
	msgs, err := c.Execute(req, unix.GENL_ID_CTRL, netlink.Request)
	if err != nil {
		return Family{}, err
	}
	families, err := buildFamilies(msgs)
	if err != nil {
		return Family{}, err
	}
	if len(families) != 1 {
		panic(fmt.Sprintf("netlink returned multiple families for name: %q", name))
	}
	return families[0], nil
}
getFamily retrieves a generic netlink family with the specified name.
package genetlink
import (
	"errors"
	"fmt"
	"math"
	"github.com/mdlayher/netlink"
	"github.com/mdlayher/netlink/nlenc"
	"golang.org/x/sys/unix"
)
var errInvalidFamilyVersion = errors.New("invalid family version attribute")