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

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.
parent 249ff340
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ define Package/gluon-client-bridge
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Provides a bridge and a wireless interface for clients to connect to
DEPENDS:=+gluon-core +kmod-macvlan
DEPENDS:=+gluon-core +kmod-veth
endef
define Build/Prepare
......
......@@ -23,6 +23,9 @@ if sysconfig.lan_ifname and not ifname and not uci:get_bool('network', 'mesh_lan
end
end
util.add_to_set(interfaces, 'local-port')
uci:delete('network', 'client')
uci:section('network', 'interface', 'client', {
type = 'bridge',
......
......@@ -8,10 +8,11 @@ local uci = require('simple-uci').cursor()
uci:delete('network', 'local_node_dev')
uci:section('network', 'device', 'local_node_dev', {
type = 'veth',
name = 'local-node',
ifname = 'br-client',
type = 'macvlan',
macaddr = site.next_node.mac,
peer_name = 'local-port',
peer_macaddr = sysconfig.primary_mac,
})
......
rule 'IN_ONLY --logical-in br-client -i ! bat0 -j DROP'
rule 'OUT_ONLY --logical-out br-client -o ! bat0 -j DROP'
rule 'IN_ONLY --logical-in br-client -i bat0 -j RETURN'
rule 'IN_ONLY --logical-in br-client -i local-port -j RETURN'
rule 'IN_ONLY --logical-in br-client -j DROP'
rule 'OUT_ONLY --logical-out br-client -o bat0 -j RETURN'
rule 'OUT_ONLY --logical-out br-client -o local-port -j RETURN'
rule 'OUT_ONLY --logical-out br-client -j DROP'
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