luci-proto-wireguard: fix configuration import
authorJo-Philipp Wich <jo@mein.io>
Mon, 5 Dec 2022 09:34:51 +0000 (10:34 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 5 Dec 2022 09:34:51 +0000 (10:34 +0100)
Avoid referencing not existing `peerdns` option during the configuration
file import process.

Fixes: #6136
Fixes: 2be01cbfcb ("luci-mod-network: restrict peerdns option to protocols that implemenent it")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js

index 068cc7b0c1763f5897853854442f328a9559cc99..1180b202e5a34953ae87802400cb5c74e931500d 100644 (file)
@@ -361,10 +361,8 @@ return network.registerProtocol('wireguard', {
                                        s.getOption('listen_port').getUIElement(s.section).setValue(config.interface_listenport || '');
                                        s.getOption('addresses').getUIElement(s.section).setValue(config.interface_address);
 
-                                       if (config.interface_dns) {
-                                               s.getOption('peerdns').getUIElement(s.section).setValue('0');
+                                       if (config.interface_dns)
                                                s.getOption('dns').getUIElement(s.section).setValue(config.interface_dns);
-                                       }
 
                                        for (var i = 0; i < config.peers.length; i++) {
                                                var pconf = config.peers[i];