From 546f2fa739ba47b7ef73a8843e71ef4ca7d58db1 Mon Sep 17 00:00:00 2001 From: yaling888 <73897884+yaling888@users.noreply.github.com> Date: Fri, 18 Mar 2022 05:17:47 +0800 Subject: [PATCH] Chore: make fake ip pool start with the third ip --- component/fakeip/pool.go | 6 ++--- component/fakeip/pool_test.go | 23 ++++++++++--------- listener/tun/ipstack/commons/router_darwin.go | 21 +++++++++-------- listener/tun/tun_adapter.go | 10 ++++---- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/component/fakeip/pool.go b/component/fakeip/pool.go index 43b9cee1..68484899 100644 --- a/component/fakeip/pool.go +++ b/component/fakeip/pool.go @@ -147,10 +147,10 @@ type Options struct { // New return Pool instance func New(options Options) (*Pool, error) { - min := ipToUint(options.IPNet.IP) + 2 + min := ipToUint(options.IPNet.IP) + 3 ones, bits := options.IPNet.Mask.Size() - total := 1<