From 598ec35701b769c630b604129d3bba688a715c17 Mon Sep 17 00:00:00 2001 From: gVisor bot 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<