luci-mod-network: fix route6 source autocomplete
authorVladislav Grigoryev <[email protected]>
Thu, 26 Aug 2021 10:33:44 +0000 (13:33 +0300)
committerFlorian Eckert <[email protected]>
Tue, 31 Aug 2021 07:00:35 +0000 (09:00 +0200)
Fix the wrong value for the "source" option of the "route6" section.

Signed-off-by: Vladislav Grigoryev <[email protected]>
(cherry picked from commit 8b4015036d6f298cbfe0291ab8fdc23b4133cca7)

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]);
                        }