Commit Graph

55 Commits

Author SHA1 Message Date
Matthias Schiffer b40b1c82e0
Merge pull request #2312 from freifunk-gluon/gluon-web-wifi-cleanup
Hide WLAN config on devices without WLAN + related cleanup
2021-12-16 20:03:27 +01:00
Matthias Schiffer f419db58a2 Set PKG_VERSION in gluon.mk
This removes PKG_VERSION and PKG_RELEASE from most Makefiles, as the
value was never useful for Gluon packages; instead, PKG_VERSION is set
to 1 in gluon.mk.

It also removes two other weird definitions:

- gluon-iptables-clamp-mss-to-pmtu replicating the old PKG_VERSION logic
  from gluon-core, but without the fixed PKG_BUILD_DIR to prevent
  unnessary rebuilds
- gluon-hoodselector set GLUON_VERSION=3
2021-10-07 23:42:38 +02:00
Matthias Schiffer 7a2cd66cb9
gluon-core: move a few WLAN-specific functions from gluon.platform to gluon.wireless
Avoid requiring gluon.wireless from gluon.platform, and requiring
gluon.platform from various other scripts.
2021-09-13 17:41:15 +02:00
Matthias Schiffer c23bc293ef treewide: remove GLUON_SPECIALIZE_KERNEL
With the removal of ramips-rt305x, the last user of
GLUON_SPECIALIZE_KERNEL is gone.
2021-07-13 21:37:39 +02:00
Andreas Ziegler ab2f82ca73
clean up old cleanup code lines (#2119)
* gluon-core: remove obsolete file 100-core-reset-sysctl

* gluon-core: remove obsolete cleanup line

* gluon-client-bridge: remove obsolete cleanup line
2020-09-17 18:19:59 +02:00
David Bauer 5b068d7c47
treewide: rename local_client zone (#2115)
This renames the local_client zone to loc_client, as local_clint exceeds
the maximum zone length allowed for firewall3, which is 11 bytes.

This worked previously due to firewall3 using unsafe string operations.
Now creation of the chain fails (latest OpenWrt master).
2020-09-13 05:24:33 +02:00
David Bauer b1de28bab1 gluon-core: move wireless-related utils to wireless module
Separate wireless-related helper methods from the util module to a
new wireless module. This keeps them separated, as the amount of
wireless helpers increased in the past, justifying a separate module.
2020-05-28 21:46:23 +02:00
Ruben Barkow-Kuder 891bfc77ac
gluon-client-bridge: simplify boolean expressions (#2031) 2020-05-25 01:13:30 +02:00
David Bauer 6692095f9d gluob-client-bridge: add support for OWE encryption 2020-04-01 01:15:38 +02:00
Matthias Schiffer da45bd5987
treewide: do not use Lua module() 2019-06-16 15:51:43 +02:00
Martin Weinelt 76f591995e gluon-client-bridge: set ra_holdoff interval to 30 seconds (#1597)
Allow odhcp6c to fork the script to handle router
advertisments in 30 seconds intervals. This is the value
that was previously used in Gluon v2018.1 / LEDE 17.01.

The default value is 3 seconds and while it is RFC compliant
it can put alot of pressure on even moderately sized devices.

Signed-off-by: Martin Weinelt <martin@darmstadt.freifunk.net>
2018-12-07 21:40:13 +01:00
Sven Eckelmann 3ef28a4684 gluon-client-bridge: Revert "move IPv4 local subnet route to br-client (#1312)"
The commit b3762fc61c ("gluon-client-bridge: move IPv4 local subnet route
to br-client (#1312)") moves the IPv4 prefix from the local-port interface
to br-client. A client requesting an IPv4 connection to the IPv4 anycast
address of the node (the device running gluon) will create following
packets:

1. ARP packet from client to get the MAC of the mac address of the anycast
   IPv4 address
2. ARP reply from node to client with the anycast MAC address for the IPv4
   anycast address
3. IPv4 packet from client which requires reply (for example ICMP echo
   request)
4. ARP request for the client MAC address for its IPv4 address in prefix4
   (done with the mac address of br-client and transmitted over br-client)
5. IPv4 packet from node (transmitted over br-client with br-client MAC
   address) as reply for the client IPv4 packet (for example ICMP echo
   reply)

The step 4 and 5 are problematic here because packets use the node specific
MAC addresses from br-client instead of the anycast MAC address. The client
will receive the ARP packet with the node specific MAC address and change
their own neighbor IP (translation) table. This will for example break the
access to the status page to the connected device or the anycast DNS
forwarder implementation when the client roams to a different node.

This reverts commit b3762fc61c and adds an
upgrade code to remove local_node_route on on existing installations.
2018-07-22 16:42:41 +02:00
Matthias Schiffer 994c94918a
treewide: automatically set SECTION and CATEGORY for Gluon packages 2018-04-14 00:01:04 +02:00
Matthias Schiffer 74f4119c1b
treewide: add support for building kernel modules used by Gluon into the kernel 2018-04-13 17:32:20 +02:00
Matthias Schiffer 25b32ec2fe
treewide: move sysctl settings to /etc/sysctl.d
net.ipv6.conf.br-client.forwarding is moved from gluon-client-bridge to
gluon-mesh-batman-adv, as the setting is not useful with non-bridged
protocols.
2018-04-13 14:41:01 +02:00
Matthias Schiffer 532b57011f
gluon-core, gluon-client-bridge: allow 0-character ESSIDs/mesh IDs 2018-03-17 15:38:24 +01:00
Jan-Tarek Butt dda1b2a127
gluon-client-bridge: check AP SSID length to be in range of 1-32 characters 2018-03-17 15:33:40 +01:00
Matthias Schiffer 60522ee253
treewide: move package Makefile boilerplate to gluon.mk 2018-03-08 19:49:41 +01:00
Matthias Schiffer 934221b86f
treewide: remove redundant definitions from package Makefiles 2018-03-07 21:23:41 +01:00
Matthias Schiffer 208cd4d98c
gluon-client-bridge: allow WLAN configs without ap section again
Fixes: 7ccdacd294 ("treewide: rework check_site_lib.lua")
2018-03-01 01:18:39 +01:00
T-X b3762fc61c gluon-client-bridge: move IPv4 local subnet route to br-client (#1312)
This patch moves the prefix4 subnet route from the local-node veth
device to br-client (while keeping the next node ipv4 address on the
local node device).

This is in preparation to allow routing over the br-client interface
later.
2018-02-16 00:00:12 +01:00
Matthias Schiffer d61f6a1e85
gluon-core: rename iterate_radios() to foreach_radio(), pass whole radio section
Allows to remove some redundant UCI lookups.
2018-02-15 14:04:37 +01:00
Matthias Schiffer 7ccdacd294
treewide: rework check_site_lib.lua
In addition to significant internal differences in check_site_lib.lua (in
particular unifying error handling to a single place for the upcoming
multi-domain support), this changes the way fields are addressed in site
check scripts: rather than providing a string like 'next_node.ip6', the
path is passed as an array {'next_node', 'ip6'}.

Other changes in site check scripts:
* need_array and need_table now pass the full path to the sub fields to the
subcheck instead of the key and value
* Any check referring to a field inside a table implies that all higher
levels must be tables if they exist: a check for {'next_node', 'ip6'} adds
an implicit (optional) check for {'next_node'}, which allows to remove many
explicit checks for such tables
2018-01-19 10:12:43 +01:00
lemoer 50812b162c
treewide: forbid use of selected site variables in domain specific or site configs
[Matthias schiffer: rebase, add a few more restrictions]
2018-01-19 04:05:27 +01:00
Matthias Schiffer 18b9174d03
Use 'disabled' attribute instead of 'auto' to disable wired mesh interfaces
The 'auto' attribute still allows enabling the interface using ifup, which
is not intended when wired mesh is disabled.
2018-01-11 23:06:36 +01:00
Matthias Schiffer 2b1ffb3034
gluon-core, gluon-client-bridge: create local_client zone in core
As core defines basic rules for this zone, it makes sense to create it
there.
2017-12-27 02:43:34 +01:00
Christof Schulze 1c1c9f8fc7
gluon-core: firewall rework, make base policy more restrictive
* gluon-core, gluon-client-bridge: introduce new firewall zone: local_client
 * gluon-core: put clients in local_client zone, introduce drop-zone,
   set dns-rules and zones
 * gluon-respondd: allow respondd on mesh
 * gluon-status-page-api: allow http input on mesh and client
2017-11-25 23:19:08 +01:00
Matthias Schiffer ee6afaced9
treewide: use new gluon.site Lua library
Some files have received some additional refactoring.
2017-08-11 22:07:34 +02:00
Matthias Schiffer 293a45456b
gluon-core, gluon-client-bridge: use new gluon.site library in gluon.util
In particular, this affects users of gluon.util.iterate_radios.
2017-08-08 14:07:09 +02:00
Matthias Schiffer eef3bba123
gluon-client-bridge: use new gluon.site library to avoid 'or {}' syntax 2017-08-08 13:53:09 +02:00
Matthias Schiffer 2b9dd54f00
gluon-client-bridge: fix 320-gluon-client-bridge-wireless coding style 2017-08-08 04:31:52 +02:00
Matthias Schiffer 08e667ba2e
gluon-client-bridge: add default next-node MAC address
The next-node MAC address doesn't need to be unique in different
communities, so we can as well add a default value.
2017-06-26 22:48:45 +02:00
Linus Lüssing 66ead88dcb gluon-client-bridge: reenable multicast snooping for client zone
LEDE recently disabled multicast snooping by default:

https://git.lede-project.org/?p=project/netifd.git;a=commitdiff;h=52541140f8138e31958cdc3d7e42a4029fa6bbc9

Reenable it for Gluon as there have been no confirmed issues for
LEDE and no negative reports concerning Gluon v2016.2.x so far.

Closes #1025.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
2017-04-13 22:31:31 +02:00
Matthias Schiffer c4613c4e8d
gluon-core: gluon.util: pass UCI cursor to get_wlan_mac(), get rid of local UCI context 2017-04-11 01:48:11 +02:00
Matthias Schiffer f48d10bdde
gluon-core: gluon.util: pass UCI cursor as argument to iterate_radios() instead of using local context 2017-04-11 01:48:11 +02:00
Matthias Schiffer f0b919e89c
gluon-client-bridge: add next-node IPv6 address as deprecated
We always want to prefer the unique node address for outgoing traffic. Note
that this doesn't have an effect with batman-adv, as usually br-client will
be the outgoing interface, so the unique address would be chosen anyways.
2017-02-23 17:58:44 +01:00
Matthias Schiffer f238b01173
gluon-client-bridge: use a veth pair instead of macvlan to connect local-node to br-client
macvlan interfaces never directly exchange traffic with the underlying
interface, but only with other hosts behind the interface. In consequence,
router advertisements from the uradvd running on br-client could never
reach local-node, preventing it from getting an IPv6 address without RAs
from an external radvd. Fix this be replacing the macvlan interface with
a veth pair (with the peer interface in br-client).

As a side effect, this saves about 5KB of flash, as the veth module is
simpler than macvlan.
2017-02-10 10:21:38 +01:00
Matthias Schiffer 57f8b9bc6a
Switch back roles of br-client and local-node interfaces
When preparing the migration from macvlan to veth for local-node, MAC
address conflicts occurred as some ports of br-client had the same address
as local-node. Reverting the roles of both interfaces fixes this.

By default, br-client is left as an interface without addresses and
firewall rules that drop everything, so the bridge is used to connect its
ports only. gluon-mesh-batman-adv-core changes this to the usual set
of addresses and firewall rules.
2017-02-10 09:58:23 +01:00
Matthias Schiffer b92dfcb966
Move creation of local-node device from gluon-mesh-batman-adv-core to gluon-client-bridge
Prepare reverting the roles of br-client and local-node to their state
before 8c4403ba11.
2017-02-10 09:42:16 +01:00
Matthias Schiffer eb350aba34
gluon-client-bridge, gluon-mesh-batman-adv-core: nicer indentation of uci:section calls
Also simplify the local_node.peerdns setting.
2017-02-10 08:16:27 +01:00
Matthias Schiffer 80de4a69e3
gluon-client-bridge: don't depend on luci.ip 2017-02-10 02:10:01 +01:00
Matthias Schiffer c83b5b3cab
treewide: get rid of luci.util outside of config mode/advanced settings 2017-02-10 02:10:01 +01:00
Matthias Schiffer 6cf03bab37
treewide: replace normal uses of luci.model.uci with simple-uci to reduce LuCI dependencies
We also make use of the boolean support of simple-uci to make scripts
clearer.
2017-02-10 02:10:01 +01:00
Matthias Schiffer 04818c170b
package: refactor add_to_set/remove_to_set to get rid of last LuCI patch 2017-01-18 16:28:54 +01:00
Matthias Schiffer 2dd8a700ca
package: avoid use of GLUONDIR variable 2017-01-17 21:22:58 +01:00
Matthias Schiffer 8c4403ba11
gluon-client-bridge, gluon-mesh-batman-adv-core: switch roles of br-client and local-node interfaces
MAC and IP addresses are switched. This makes the gluon-client-bridge
package more useful for different routing protocols that don't need a
unique address on the client bridge.

As a side effect, gluon-radvd is now using the next-node address, which had
been considered before, but was dismissed to avoid having gluon-radvd
depend on gluon-next-node and gluon-mesh-batman-adv. This will be useful
for announcing default routes via gluon-radvd.

One downside is that this introduces a minor dependency on batman-adv in
gluon-respondd: the hotplug script that checked for the client interface
before will now check for local-node. This doesn't really matter: for mesh
protocols without a local-node interface, the check will do nothing (which
makes sense, as there is no interface to bind to for mesh-wide respondd).
2016-12-10 23:43:44 +01:00
Matthias Schiffer 9a5a8e0ab0
gluon-client-bridge: add LAN interfaces to client bridge by default (instead of doing this in the batman-adv-specific scripts)
This allows to weaken the gluon-mesh-batman-adv-core dependency of
gluon-luci-portconfig to gluon-client-bridge.
2016-09-07 02:14:42 +02:00
Matthias Schiffer 806af27083
gluon-client-bridge, gluon-mesh-batman-adv-core: make macaddr variable local in upgrade script 2016-07-27 17:25:05 +02:00
Matthias Schiffer 2afe34efec
Use MAC addresses provided by WLAN drivers by default
Some drivers (mt76) don't support arbitrary MAC addresses. Use the
addresses provided by the driver (avoiding the primary address) by default,
but fall back to our has-based scheme when the driver doesn't provide
(enough) addresses.
2016-07-20 18:42:56 +02:00
Matthias Schiffer 849af9ade0
gluon-client-bridge, gluon-mesh-batman-adv-core: simplify VIF config functions 2016-07-20 15:44:36 +02:00