Skip to content
Snippets Groups Projects
Unverified Commit 80de4a69 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-client-bridge: don't depend on luci.ip

parent e665bfe6
No related branches found
No related tags found
No related merge requests found
...@@ -4,15 +4,14 @@ local site = require 'gluon.site_config' ...@@ -4,15 +4,14 @@ local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
local util = require 'gluon.util' local util = require 'gluon.util'
local ip = require 'luci.ip'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local ip4, netmask, ip6 local ip4, ip6
if site.next_node.ip4 then if site.next_node.ip4 then
ip4 = site.next_node.ip4 local plen = site.prefix4:match('/%d+$')
netmask = ip.IPv4(site.prefix4):mask():string() ip4 = site.next_node.ip4 .. plen
end end
if site.next_node.ip6 then if site.next_node.ip6 then
...@@ -25,7 +24,6 @@ uci:section('network', 'interface', 'client', ...@@ -25,7 +24,6 @@ uci:section('network', 'interface', 'client',
proto = 'static', proto = 'static',
macaddr = site.next_node.mac, macaddr = site.next_node.mac,
ipaddr = ip4, ipaddr = ip4,
netmask = netmask,
ip6addr = ip6, ip6addr = ip6,
} }
) )
...@@ -33,6 +31,7 @@ uci:section('network', 'interface', 'client', ...@@ -33,6 +31,7 @@ uci:section('network', 'interface', 'client',
uci:delete('network', 'client', 'reqprefix') uci:delete('network', 'client', 'reqprefix')
uci:delete('network', 'client', 'peerdns') uci:delete('network', 'client', 'peerdns')
uci:delete('network', 'client', 'sourcefilter') uci:delete('network', 'client', 'sourcefilter')
uci:delete('network', 'client', 'netmask')
local interfaces = uci:get('network', 'client', 'ifname') or {} local interfaces = uci:get('network', 'client', 'ifname') or {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment