Commit 04643981 authored by Chris Fiege's avatar Chris Fiege
Browse files

parker: remove prefix6 and prefix4

This change removes the prefix4 and prefix6 attributes from the
site.conf. These do not make sense in the context of parker.

Packages that are usually used in parker do not use these anymore. Some
other packages do - you should not enable those :-)

With this change a ipv6 route to prefix_6 will no longer be set on
br-client. Systems that already have this route will keep it.

With this change the (not working) redirect in the http status page has
been removed. We should consider to add this later on.
parent f713312d
need_string_match(in_domain({'next_node', 'mac'}), '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$', false)
if need_string_match(in_domain({'next_node', 'ip4'}), '^%d+.%d+.%d+.%d+$', false) then
need_string_match(in_domain({'prefix4'}), '^%d+.%d+.%d+.%d+/%d+$')
end
need_string_match(in_domain({'next_node', 'ip6'}), '^[%x:]+$', false)
......
......@@ -23,8 +23,7 @@ uci:section('network', 'device', 'local_node_dev', {
local ip4, ip6
if next_node.ip4 then
local plen = site.prefix4():match('/%d+$')
ip4 = next_node.ip4 .. plen
ip4 = next_node.ip4 .. '/32'
end
if next_node.ip6 then
......
......@@ -26,8 +26,6 @@ need_string(in_site({'timezone'}))
need_string_array({'ntp_servers'}, false)
need_string_match(in_domain({'prefix6'}), '^[%x:]+/64$')
local supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000}
for _, config in ipairs({'wifi24', 'wifi5'}) do
if need_table({config}, nil, false) then
......
......@@ -25,13 +25,6 @@ uci:delete('network', 'client_lan')
uci:delete('network', 'local_node_route')
uci:delete('network', 'local_node_route6')
uci:section('network', 'route6', 'local_node_route6', {
interface = 'client',
target = site.prefix6(),
gateway = '::',
})
uci:save('network')
local networks = uci:get_list('firewall', 'mesh', 'network')
......
......@@ -35,14 +35,6 @@ uci:section('firewall', 'rule', 'mesh_respondd_ll', {
target = 'ACCEPT',
})
uci:section('firewall', 'rule', 'mesh_respondd_siteprefix', {
name = 'mesh_respondd_siteprefix',
src = 'mesh',
src_ip = site.prefix6(),
dest_port = '1001',
proto = 'udp',
target = 'ACCEPT',
})
uci:delete_all('firewall', 'rule', function(rule)
return rule['.name']:find('^mesh_respondd_extraprefix')
......
......@@ -63,24 +63,7 @@ end
entry({}, call(function(http, renderer)
local nodeinfo = json.parse(util.exec('exec gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r nodeinfo'))
local node_ip = parse_ip(http:getenv('SERVER_ADDR'))
if node_ip and (
match(node_ip, parse_ip(site.next_node.ip4()), 8) or
match(node_ip, parse_ip(site.next_node.ip6()), 8)
) then
-- The user has visited the status page via a next-node address
-- Redirect the user to a unique address to avoid switching nodes
local prefix = parse_ip(site.prefix6():match('^[^/]+'))
for _, addr in ipairs(nodeinfo.network.addresses) do
if match(prefix, parse_ip(addr), 4) then
http:header('Cache-Control', 'no-cache, no-store, must-revalidate')
http:redirect('http://[' .. addr .. ']' .. http:getenv('REQUEST_URI'))
http:close()
return
end
end
end
-- TODO: Add a redirect to a local v6 addr for parker
renderer.render('status-page', { nodeinfo = nodeinfo, site = site }, 'gluon-status-page')
end))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment