[PATCH] fff-network: add dummy iface to force bridge to up

Tim Niemeyer tim at tn-x.org
So Jan 21 13:43:55 CET 2018


Hi

Am Sonntag, den 21.01.2018, 13:38 +0100 schrieb
mail at adrianschmutzler.de:
> Hallo Tim,
> 
> als ich das mit dem "Workaround" geschrieben hatte, hatte ich noch
> weniger von der Sache verstanden.
> 
> Ich finde deinen Kompromiss aber nicht schlecht, ich würde mir auch
> gerne die Zeit nehmen, deine Lösung besser zu verstehen.
> 
> Ich lasse mich auch gerne überzeugen, ich mag halt zunächst die Idee
> mit den Dummy-Interfaces eher nicht.
> 
> Für ein alpha-Release hat meine Lösung im Moment den Vorteil, dass
> sie zumindest in meiner Firmware getestet ist und das Alfred jetzt
> tatsächlich immer funktioniert.
Na, dann machen wir es doch so.

> Für einen richtigen Test deines Patches muss man ja dann auch die
> alten Dummy-Interfaces mit rauspatchen, sonst ist das Problem gar
> nicht reproduzierbar (weil dann beim Boot ja Dummy-w2mesh vorhanden
> ist). Das würde ich gerne noch gut testen.
Ich glaube die dummy-wifi Sachen waren nur beim firstboot, oder?

Zumindest hatte ich hier den alfred Fehler reprodzieren können und ihne
eben auch beheben können.

Tim

> Grüße
> 
> Adrian
> 
> > -----Original Message-----
> > From: Tim Niemeyer [mailto:tim at tn-x.org]
> > Sent: Sonntag, 21. Januar 2018 13:13
> > To: mail at adrianschmutzler.de; franken-dev at freifunk.net; 'Christian
> > Dresel'
> > <fff at chrisi01.de>
> > Subject: Re: [PATCH] fff-network: add dummy iface to force bridge
> > to up
> > 
> > Moin
> > 
> > Am Sonntag, den 21.01.2018, 13:08 +0100 schrieb
> > mail at adrianschmutzler.de:
> > > Hallo,
> > > 
> > > mich würde interessieren, ob es ein objektiveres Kriterium als
> > > "sauberer" gibt.
> > > 
> > > Den was "sauber" ist, liegt oft (nicht immer) im Auge des
> > > Betrachters.
> > 
> > Zum einen hast du selber gesagt, dass deine Lösung nur ein
> > Workaround ist.
> > 
> > > Und so einen richtigen Grund, warum der restart schlechter ist,
> > > habe
> > > ich leider noch nicht gehört.
> > 
> > Zum anderen halte ich es für unschön, wenn man den alfred ständig
> > tritt,
> > obwohl der eigentlich vielleicht grad super läuft und gerade mitten
> > irgendwelche wichtigen Synchronisierungstätigkeiten macht. Keine
> > Ahnung
> > ob der das tut, aber einfach ohne Grund immer neustarten ist aus
> > meiner
> > Sicht unsauber.
> > 
> > Die Frage ist, wie kommen wir da jetzt weiter. Ich sehe aktuell bei
> > deiner
> > Lösung weniger Risiko das was ernsthaftes kaputt geht. Meine Lösung
> > greift
> > tiefer ins System ein.
> > 
> > Ich schlage daher vor wir applien deinen Patch, nach dem Release
> > reverten
> > wir den und applien meinen.
> > 
> > Tim
> > 
> > > Grüße
> > > 
> > > adrian
> > > 
> > > > -----Original Message-----
> > > > From: franken-dev [mailto:franken-dev-bounces at freifunk.net] On
> > > > Behalf Of Christian Dresel
> > > > Sent: Sonntag, 21. Januar 2018 10:23
> > > > To: Tim Niemeyer <tim at tn-x.org>; franken-dev at freifunk.net
> > > > Subject: Re: [PATCH] fff-network: add dummy iface to force
> > > > bridge to
> > > > up
> > > > 
> > > > Hallo Tim
> > > > 
> > > > Tested-by: Christian Dresel <fff at chrisi01.de>
> > > > 
> > > > Prinzipiell gesagt:
> > > > Dies ist "sauberer" als Alfred neu zu starten im configurehood,
> > > > von
> > > > der Seite gefällt es mir besser. Es legt aber wieder ein neues
> > > > Interface an (sind ja eh schon genug...), und braucht
> > > > anscheinend
> > > > einen weiteren kmod (keine Ahnung wieviel Speicher das frisst,
> > > > hab
> > > > nicht nachgeguckt, 841er FW hat aber noch gebaut).
> > > > Im Endeffekt bin ich aber für diese Idee da einfach sauberer.
> > > > 
> > > > bridge_empty '1' & force_link '1' alleine ohne den dummy
> > > > Interface
> > > > reichen nicht damit die Bridge immer "an" ist?
> > > > 
> > > > bisschen was Inline:
> > > > 
> > > > On 20.01.2018 19:05, Tim Niemeyer wrote:
> > > > > Fixes #78
> > > > > 
> > > > > Signed-off-by: Tim Niemeyer <tim at tn-x.org>
> > > > > ---
> > > > > 
> > > > >  src/packages/fff/fff-network/Makefile              |  4 ++--
> > > > >  .../fff/fff-network/files/etc/config/network       |  6
> > > > > ++++++
> > > > >  .../fff-network/files/lib/netifd/proto/dummy.sh    | 24
> > > > 
> > > > ++++++++++++++++++++++
> > > > >  .../fff-network/files/usr/sbin/configurenetwork    |  8
> > > > > ++++----
> > > > >  4 files changed, 36 insertions(+), 6 deletions(-)  create
> > > > > mode
> > > > > 100755
> > > > > src/packages/fff/fff-network/files/lib/netifd/proto/dummy.sh
> > > > > 
> > > > > diff --git a/src/packages/fff/fff-network/Makefile
> > > > > b/src/packages/fff/fff-network/Makefile
> > > > > index 348897d..6700682 100644
> > > > > --- a/src/packages/fff/fff-network/Makefile
> > > > > +++ b/src/packages/fff/fff-network/Makefile
> > > > > @@ -1,7 +1,7 @@
> > > > >  include $(TOPDIR)/rules.mk
> > > > > 
> > > > >  PKG_NAME:=fff-network
> > > > > -PKG_VERSION:=10
> > > > > +PKG_VERSION:=11
> > > > >  PKG_RELEASE:=1
> > > > > 
> > > > >  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
> > > > > @@ -13,7 +13,7 @@ define Package/$(PKG_NAME)
> > > > >      CATEGORY:=Freifunk
> > > > >      TITLE:= Freifunk-Franken network configuration
> > > > >      URL:=http://www.freifunk-franken.de
> > > > > -    DEPENDS:=+fff-uradvd +fff-boardname
> > > > > +    DEPENDS:=+fff-uradvd +fff-boardname +kmod-dummy
> > > > >  endef
> > > > > 
> > > > >  define Package/$(PKG_NAME)/description diff --git
> > > > > a/src/packages/fff/fff-network/files/etc/config/network
> > > > > b/src/packages/fff/fff-network/files/etc/config/network
> > > > > index 08a897b..6ee3443 100644
> > > > > --- a/src/packages/fff/fff-network/files/etc/config/network
> > > > > +++ b/src/packages/fff/fff-network/files/etc/config/network
> > > > > @@ -4,9 +4,15 @@ config interface 'loopback'
> > > > >          option ipaddr '127.0.0.1'
> > > > >          option netmask '255.0.0.0'
> > > > > 
> > > > > +config interface 'dummy'
> > > > > +        option proto 'dummy'
> > > > > +
> > > > >  config interface 'mesh'
> > > > >          option type 'bridge'
> > > > > +        option ifname 'dummy0'
> > > > >          option auto '1'
> > > > > +        option bridge_empty '1'
> > > > > +        option force_link '1'
> > > > > 
> > > > >  config interface 'wan'
> > > > >          option proto 'dhcp'
> > > > > diff --git
> > > > > a/src/packages/fff/fff-
> > > > > network/files/lib/netifd/proto/dummy.sh
> > > > > b/src/packages/fff/fff-
> > > > > network/files/lib/netifd/proto/dummy.sh
> > > > > new file mode 100755
> > > > > index 0000000..8cb9994
> > > > > --- /dev/null
> > > > > +++ b/src/packages/fff/fff-
> > > > > network/files/lib/netifd/proto/dummy.sh
> > > > 
> > > > kannst du mir (grob) erklären was dieses Script tut? Wird
> > > > irgendwie
> > > > nirgens aufgerufen und versteh daher nicht warum es nötig ist.
> > > > 
> > > > > @@ -0,0 +1,24 @@
> > > > > +#!/bin/sh
> > > > > +
> > > > > +. /lib/functions.sh
> > > > > +. ../netifd-proto.sh
> > > > > +init_proto "$@"
> > > > > +
> > > > > +proto_dummy_setup() {
> > > > > +	local config="$1"
> > > > > +	local iface="$2"
> > > > > +
> > > > > +    ip link add "$iface" type dummy
> > > > 
> > > > Tab statt Leerzeichen
> > > > 
> > > > > +
> > > > > +	proto_init_update "$iface" 1
> > > > > +	proto_send_update "$config"
> > > > > +}
> > > > > +
> > > > > +proto_dummy_teardown() {
> > > > > +	local config="$1"
> > > > > +	local iface="$2"
> > > > > +
> > > > > +    ip link delete dev "$iface"
> > > > 
> > > > Tab statt Leerzeichen
> > > > 
> > > > mfg
> > > > 
> > > > Christian
> > > > 
> > > > > +}
> > > > > +
> > > > > +add_protocol dummy
> > > > > diff --git
> > > > > a/src/packages/fff/fff-
> > > > > network/files/usr/sbin/configurenetwork
> > > > > b/src/packages/fff/fff-
> > > > > network/files/usr/sbin/configurenetwork
> > > > > index f318d8e..51a3487 100755
> > > > > --- a/src/packages/fff/fff-
> > > > > network/files/usr/sbin/configurenetwork
> > > > > +++ b/src/packages/fff/fff-
> > > > > network/files/usr/sbin/configurenetwork
> > > > > @@ -110,7 +110,7 @@ if ! uci -q get network.$SWITCHDEV >
> > > > > /dev/null
> > > > > > > [
> > > > 
> > > > "$FORCEPARSE" = '1' ] ; then
> > > > >      uci set network.${SWITCHDEV}_3.vlan=3
> > > > >      uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
> > > > > 
> > > > > -    uci set network.mesh.ifname="$SWITCHDEV.1 bat0"
> > > > > +    uci set network.mesh.ifname="dummy0 $SWITCHDEV.1 bat0"
> > > > > 
> > > > >      uci set network.ethmesh.ifname="$SWITCHDEV.3"
> > > > > 
> > > > > @@ -131,7 +131,7 @@ if [ "$ONE_PORT" = "YES" ] && ( ! uci -q
> > > > > get
> > > > 
> > > > network.$SWITCHDEV.ifname || [ "$FO
> > > > >          echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 1" >>
> > > > 
> > > > /etc/sysctl.conf
> > > > >          echo "net.ipv6.conf.$WANDEV.autoconf = 1" >>
> > > > > /etc/sysctl.conf
> > > > >          echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 1"
> > > > > >>
> > > > 
> > > > /etc/sysctl.conf
> > > > > -        uci set network.mesh.ifname="bat0"
> > > > > +        uci set network.mesh.ifname="dummy0 bat0"
> > > > >          uci set network.wan.ifname="$WANDEV"
> > > > >          uci del uci set network.ethmesh.ifname
> > > > >          uci del network.eth0.macaddr @@ -140,7 +140,7 @@ if
> > > > > [
> > > > > "$ONE_PORT" = "YES" ] && ( ! uci -q get
> > > > 
> > > > network.$SWITCHDEV.ifname || [ "$FO
> > > > >          echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 0" >>
> > > > 
> > > > /etc/sysctl.conf
> > > > >          echo "net.ipv6.conf.$WANDEV.autoconf = 0" >>
> > > > > /etc/sysctl.conf
> > > > >          echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 0"
> > > > > >>
> > > > 
> > > > /etc/sysctl.conf
> > > > > -        uci set network.mesh.ifname="bat0 $SWITCHDEV"
> > > > > +        uci set network.mesh.ifname="dummy0 bat0 $SWITCHDEV"
> > > > >          uci set network.wan.ifname="eth1" #eth1 because it
> > > > > is
> > > > > default in
> > > > 
> > > > config file
> > > > >          uci del network.ethmesh.ifname
> > > > >          uci del network.eth0.macaddr @@ -149,7 +149,7 @@ if
> > > > > [
> > > > > "$ONE_PORT" = "YES" ] && ( ! uci -q get
> > > > 
> > > > network.$SWITCHDEV.ifname || [ "$FO
> > > > >          echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 0" >>
> > > > 
> > > > /etc/sysctl.conf
> > > > >          echo "net.ipv6.conf.$WANDEV.autoconf = 0" >>
> > > > > /etc/sysctl.conf
> > > > >          echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 0"
> > > > > >>
> > > > 
> > > > /etc/sysctl.conf
> > > > > -        uci set network.mesh.ifname="bat0"
> > > > > +        uci set network.mesh.ifname="dummy0 bat0"
> > > > >          uci set network.wan.ifname="eth1" #eth1 because it
> > > > > is
> > > > > default in
> > > > 
> > > > config file
> > > > >          uci set network.ethmesh.ifname="$SWITCHDEV"
> > > > >          ETH0MAC="w2ap"
> > > > > 
> > > 
> > > 
> 
> 
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 488 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20180121/9f719db7/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev