Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Solodkov <oleg.solodkov@xored.com>
  • Loading branch information
sol-0 committed Dec 14, 2021
1 parent dc34371 commit d31e64f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions pkg/networkservice/chains/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/networkservicemesh/sdk/pkg/networkservice/common/clienturl"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/connect"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/dial"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/excludedprefixes"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/null"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/refresh"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/trimpath"
Expand Down Expand Up @@ -58,7 +57,6 @@ func NewClient(ctx context.Context, clientOpts ...Option) networkservice.Network
metadata.NewClient(),
opts.refreshClient,
clienturl.NewClient(opts.clientURL),
excludedprefixes.NewClient(),
clientconn.NewClient(opts.cc),
opts.healClient,
dial.NewClient(ctx,
Expand Down
11 changes: 6 additions & 5 deletions pkg/networkservice/common/excludedprefixes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ func (epc *excludedPrefixesClient) Request(ctx context.Context, request *network
return resp, err
}

logger.Debugf("Request excluded IPs - srcIPs: %v, dstIPs: %v",
resp.GetContext().GetIpContext().GetSrcIpAddrs(), resp.GetContext().GetIpContext().GetDstIpAddrs())
respIpContext := resp.GetContext().GetIpContext()
logger.Debugf("Request excluded IPs - srcIPs: %v, dstIPs: %v, excluded prefixes: %v", respIpContext.GetSrcIpAddrs(),
respIpContext.GetDstIpAddrs(), respIpContext.GetExcludedPrefixes())

<-epc.executor.AsyncExec(func() {
epc.excludedPrefixes = append(epc.excludedPrefixes, ipCtx.GetSrcIpAddrs()...)
epc.excludedPrefixes = append(epc.excludedPrefixes, ipCtx.GetDstIpAddrs()...)
epc.excludedPrefixes = append(epc.excludedPrefixes, ipCtx.GetExcludedPrefixes()...)
epc.excludedPrefixes = append(epc.excludedPrefixes, respIpContext.GetSrcIpAddrs()...)
epc.excludedPrefixes = append(epc.excludedPrefixes, respIpContext.GetDstIpAddrs()...)
epc.excludedPrefixes = append(epc.excludedPrefixes, respIpContext.GetExcludedPrefixes()...)
epc.excludedPrefixes = removeDuplicates(epc.excludedPrefixes)
logger.Debugf("Added excluded prefixes: %+v", epc.excludedPrefixes)
})
Expand Down

0 comments on commit d31e64f

Please sign in to comment.