feat(routing): log default route family as string

This commit is contained in:
Quentin McGaw
2023-04-27 10:41:03 +00:00
parent e165bb6870
commit 80053f6b7d
2 changed files with 15 additions and 2 deletions

View File

@@ -13,6 +13,19 @@ const (
FAMILY_V6 = netlink.FAMILY_V6
)
func FamilyToString(family int) string {
switch family {
case FAMILY_ALL:
return "all"
case FAMILY_V4:
return "v4"
case FAMILY_V6:
return "v6"
default:
return fmt.Sprint(family)
}
}
func (n *NetLink) IsWireguardSupported() (ok bool, err error) {
families, err := netlink.GenlFamilyList()
if err != nil {