From d832d540d06fbe523bcb9524963ea67ced1cf255 Mon Sep 17 00:00:00 2001
From: cedi <cedi@users.noreply.github.com>
Date: Tue, 13 Nov 2018 00:34:17 +0100
Subject: [PATCH] Make IPFamily consts an int

this makes it unnecessary to cast it to int when calling the netlink API
---
 protocols/netlink/netlink_reader.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/protocols/netlink/netlink_reader.go b/protocols/netlink/netlink_reader.go
index 0896b967..16cb3a53 100644
--- a/protocols/netlink/netlink_reader.go
+++ b/protocols/netlink/netlink_reader.go
@@ -16,8 +16,8 @@ import (
 
 // Constants for IP family
 const (
-	IPFamily4 = 4 // IPv4
-	IPFamily6 = 6 // IPv6
+	IPFamily4 int = 4 // IPv4
+	IPFamily6 int = 6 // IPv6
 )
 
 // NetlinkReader read routes from the Linux Kernel and propagates it to the locRIB
@@ -49,7 +49,7 @@ func (nr *NetlinkReader) Read() {
 
 	for {
 		// Family doesn't matter. I only filter by the rt_table here
-		routes, err := netlink.RouteListFiltered(int(IPFamily4), &netlink.Route{Table: int(nr.options.RoutingTable)}, netlink.RT_FILTER_TABLE)
+		routes, err := netlink.RouteListFiltered(IPFamily4, &netlink.Route{Table: int(nr.options.RoutingTable)}, netlink.RT_FILTER_TABLE)
 		if err != nil {
 			log.WithError(err).Panic("Failed to read routes from kernel")
 		}
-- 
GitLab