GoBackend: Parse the dns address

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Aurélien Chabot 2018-03-02 20:48:35 +11:00 committed by Jason A. Donenfeld
parent 6878aba911
commit c6d311923a

View File

@ -191,7 +191,7 @@ public final class GoBackend implements Backend {
InetAddress address = InetAddress.getByName(config.getInterface().getAddress()); InetAddress address = InetAddress.getByName(config.getInterface().getAddress());
builder.addAddress(address.getHostAddress(), (address instanceof Inet4Address) ? 32 : 128); builder.addAddress(address.getHostAddress(), (address instanceof Inet4Address) ? 32 : 128);
if (config.getInterface().getDns() != null) if (config.getInterface().getDns() != null)
builder.addDnsServer(config.getInterface().getDns()); builder.addDnsServer(InetAddress.getByName(config.getInterface().getDns()).getHostAddress());
for (final Peer peer : config.getPeers()) { for (final Peer peer : config.getPeers()) {
if (peer.getAllowedIPs() != null) { if (peer.getAllowedIPs() != null) {