diff --git a/common.go b/common.go index e9b03ed..7836e5e 100644 --- a/common.go +++ b/common.go @@ -18,22 +18,6 @@ import ( "strings" ) -// Pulled from http://man7.org/linux/man-pages/man7/rtnetlink.7.html -// See the section on RTM_NEWROUTE, specifically 'struct rtmsg'. -type routeInfoInMemory struct { - Family byte - DstLen byte - SrcLen byte - TOS byte - - Table byte - Protocol byte - Scope byte - Type byte - - Flags uint32 -} - // rtInfo contains information on a single route. type rtInfo struct { Src, Dst *net.IPNet diff --git a/netroute_bsd.go b/netroute_bsd.go index 76ce8db..c3d9d1c 100644 --- a/netroute_bsd.go +++ b/netroute_bsd.go @@ -69,10 +69,10 @@ func New() (routing.Router, error) { routeInfo := new(rtInfo) if m.Version < 3 || m.Version > 5 { - return nil, fmt.Errorf("Unexpected RIB message version: %d", m.Version) + return nil, fmt.Errorf("unexpected RIB message version: %d", m.Version) } if m.Type != 4 /* RTM_GET */ { - return nil, fmt.Errorf("Unexpected RIB message type: %d", m.Type) + return nil, fmt.Errorf("unexpected RIB message type: %d", m.Type) } if m.Flags&RTF_UP == 0 || @@ -95,7 +95,7 @@ func New() (routing.Router, error) { } routeInfo.Dst = ipn } else { - return nil, fmt.Errorf("Unexpected RIB destination: %v", err) + return nil, fmt.Errorf("unexpected RIB destination: %v", err) } if m.Flags&RTF_GATEWAY != 0 { diff --git a/netroute_linux.go b/netroute_linux.go index 203f285..a83815d 100644 --- a/netroute_linux.go +++ b/netroute_linux.go @@ -20,6 +20,22 @@ import ( "github.com/google/gopacket/routing" ) +// Pulled from http://man7.org/linux/man-pages/man7/rtnetlink.7.html +// See the section on RTM_NEWROUTE, specifically 'struct rtmsg'. +type routeInfoInMemory struct { + Family byte + DstLen byte + SrcLen byte + TOS byte + + Table byte + Protocol byte + Scope byte + Type byte + + Flags uint32 +} + func New() (routing.Router, error) { rtr := &router{} rtr.ifaces = make(map[int]net.Interface)