[#607] network: Generalize LocalAddressSource to address group

Make `LocalAddressSource.LocalAddress` method to return `AddressGroup`. Make
`IsLocalAddress` function to accept parameter of type `AddressGroup`. Adopt
the application code with temporary `GroupFromAddress` helper.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-22 13:25:44 +03:00 committed by Leonard Lyubich
parent e11f50ec8e
commit 6e5d7f84af
7 changed files with 15 additions and 15 deletions

View file

@ -225,7 +225,7 @@ func (r *remoteLoadAnnounceProvider) InitRemote(srv loadroute.ServerInfo) (loadc
return nil, fmt.Errorf("could not convert address to IP format: %w", err)
}
if network.IsLocalAddress(r.loadAddrSrc, netAddr) {
if network.IsLocalAddress(r.loadAddrSrc, network.GroupFromAddress(netAddr)) {
// if local => return no-op writer
return loadcontroller.SimpleWriterProvider(new(nopLoadWriter)), nil
}