From 6bb6f8abbc420ec09282fc62e05f5548d546455a Mon Sep 17 00:00:00 2001 From: open-cmi Date: Wed, 9 Feb 2022 15:03:57 +0800 Subject: [PATCH] fix: build failed on macos when use RT_FILTER_TABLE --- route.go | 18 ++++++++++++++++++ route_linux.go | 17 ----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/route.go b/route.go index ffad5d3..79cc218 100644 --- a/route.go +++ b/route.go @@ -11,6 +11,24 @@ type Scope uint8 type NextHopFlag int +const ( + RT_FILTER_PROTOCOL uint64 = 1 << (1 + iota) + RT_FILTER_SCOPE + RT_FILTER_TYPE + RT_FILTER_TOS + RT_FILTER_IIF + RT_FILTER_OIF + RT_FILTER_DST + RT_FILTER_SRC + RT_FILTER_GW + RT_FILTER_TABLE + RT_FILTER_HOPLIMIT + RT_FILTER_PRIORITY + RT_FILTER_MARK + RT_FILTER_MASK + RT_FILTER_REALM +) + type Destination interface { Family() int Decode([]byte) error diff --git a/route_linux.go b/route_linux.go index 0227471..8da8866 100644 --- a/route_linux.go +++ b/route_linux.go @@ -41,23 +41,6 @@ func (s Scope) String() string { } } -const ( - RT_FILTER_PROTOCOL uint64 = 1 << (1 + iota) - RT_FILTER_SCOPE - RT_FILTER_TYPE - RT_FILTER_TOS - RT_FILTER_IIF - RT_FILTER_OIF - RT_FILTER_DST - RT_FILTER_SRC - RT_FILTER_GW - RT_FILTER_TABLE - RT_FILTER_HOPLIMIT - RT_FILTER_PRIORITY - RT_FILTER_MARK - RT_FILTER_MASK - RT_FILTER_REALM -) const ( FLAG_ONLINK NextHopFlag = unix.RTNH_F_ONLINK