diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 3d317cbf4de9f0b85cbb54df72b982d262939412..a152eca6435e4c105b509b8aefd5c271c187bd1c 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -18,7 +18,7 @@ -- 32 bytes of random data, encoded in hexadecimal -- Must be the same for all nodes in one mesh domain -- Can be generated using: echo $(hexdump -v -n 32 -e '1/1 "%02x"' </dev/urandom) - site_seed = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', + domain_seed = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', -- Prefixes used within the mesh. -- prefix6 is required, prefix4 can be omitted if next_node.ip4 diff --git a/docs/user/site.rst b/docs/user/site.rst index 048e3f5e49f9be46a126e91258037e3b00b3795d..45f7d7edad76225284d1a585c6b1cf7f59e0259e 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -21,7 +21,7 @@ site_code The code of your community. It is good practice to use the TLD of your community here. -site_seed +domain_seed 32 bytes of random data, encoded in hexadecimal, used to seed other random values specific to the mesh domain. It must be the same for all nodes of one mesh, but should be different for firmwares that are not supposed to mesh with diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua index 72fce8a4195ef806cce3e7bf5b9a6ccda569c914..95ddba2ebac36a17e67ccd7b3522bb28243bae7d 100644 --- a/package/gluon-core/check_site.lua +++ b/package/gluon-core/check_site.lua @@ -1,6 +1,6 @@ need_string 'site_code' need_string 'site_name' -need_string_match('site_seed', '^' .. ('%x'):rep(64) .. '$') +need_string_match('domain_seed', '^' .. ('%x'):rep(64) .. '$') if need_table('opkg', nil, false) then need_string('opkg.lede', false) diff --git a/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh b/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh index 9431bbce786ef48eb068243c1587dcd55b6469b0..46c4a12473bc2f7e8eca81c2927788c1979774e7 100755 --- a/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh +++ b/package/gluon-core/files/lib/netifd/proto/gluon_wired.sh @@ -44,7 +44,7 @@ proto_gluon_wired_setup() { json_add_string tunlink "$config" json_add_string ip6addr "$(interface_linklocal "$ifname")" json_add_string peer6addr 'ff02::15c' - json_add_int vid "$(lua -lgluon.util -e 'print(tonumber(gluon.util.site_seed_bytes("gluon-mesh-vxlan", 3), 16))')" + json_add_int vid "$(lua -lgluon.util -e 'print(tonumber(gluon.util.domain_seed_bytes("gluon-mesh-vxlan", 3), 16))')" json_close_object ubus call network add_dynamic "$(json_dump)" fi diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua index 5ee6c376db0664cb763dcd708e3f8b8f4dc82fc2..a1da17689037cb086249f9152741ccc77a8b51ad 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua @@ -122,7 +122,7 @@ function node_id() return string.gsub(sysconfig.primary_mac, ':', '') end -function site_seed_bytes(key, length) +function domain_seed_bytes(key, length) local ret = '' local v = '' local i = 0 @@ -131,7 +131,7 @@ function site_seed_bytes(key, length) -- cryptographic strength while ret:len() < 2*length do i = i + 1 - v = hash.md5(v .. key .. site.site_seed():lower() .. i) + v = hash.md5(v .. key .. site.domain_seed():lower() .. i) ret = ret .. v end