luci-mod-network: fix route6 source autocomplete 5303/head
authorVladislav Grigoryev <vg.aetera@gmail.com>
Thu, 26 Aug 2021 10:33:44 +0000 (13:33 +0300)
committerVladislav Grigoryev <vg.aetera@gmail.com>
Thu, 26 Aug 2021 10:38:08 +0000 (13:38 +0300)
Fix the wrong value for the "source" option of the "route6" section.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/routes.js

index 7e11a3cb4181c28680b94fdf8e87297dc1c2a837..164619940ca8cef661835a92049a74b847f29334 100644 (file)
@@ -89,7 +89,7 @@ return view.extend({
                        o = s.taboption('advanced', form.Value, 'source', _('Source Address'));
                        o.placeholder = E('em', _('automatic'));
                        for (var j = 0; j < netdevs.length; j++) {
-                               var addrs = netdevs[j].getIPAddrs();
+                               var addrs = (i == 4) ? netdevs[j].getIPAddrs() : netdevs[j].getIP6Addrs();
                                for (var k = 0; k < addrs.length; k++)
                                        o.value(addrs[k].split('/')[0]);
                        }