freifunk-berlin / falter-packages

Sources for the falter-packagefeed
GNU General Public License v3.0
13 stars 17 forks source link

tunnelmanager: fix adding interfaces by reloading again #402

Closed Noki closed 1 year ago

Noki commented 1 year ago

After creating new tunnels the ipc calls are often unreliably and olsrd even crashes in combination with using ipc, which results in unconfigured interfaces. The problem is that the current ipc code simply does not have any error handling to deal with failed calls. This change switches back to reloading olsrd and babeld to make tunnels more reliably in order to prevent nodes from getting isolated, but reintroduces the issue of loosing routes when doing a reload. A solution to this is pointed out here: https://github.com/freifunk-berlin/falter-packages/issues/401#issuecomment-1689911339

For reference a log that shows olsrd crashing with ipc.

Mon Sep 11 15:19:38 2023 user.notice tunnelman: Server handling least clients is: 77.87.51.131. Trying to create tunnel...
Mon Sep 11 15:19:40 2023 user.notice wg-client-installer: Registered: wg_51820
Mon Sep 11 15:19:40 2023 user.notice tunnelman: New tunnel interface is wg_51820
Mon Sep 11 15:19:43 2023 daemon.err babeld[13372]: ioctl(SIOCGIWNAME): Not a tty
Mon Sep 11 15:19:43 2023 daemon.err babeld[13372]: Warning: couldn't determine whether wg_51820 (38) is a wireless interface.
Mon Sep 11 15:19:44 2023 daemon.info olsrd[12887]: Writing '0' (was 0) to /proc/sys/net/ipv4/conf/wg_51820/send_redirects
Mon Sep 11 15:19:44 2023 daemon.info olsrd[12887]: Writing '0' (was 0) to /proc/sys/net/ipv4/conf/wg_51820/rp_filter
Mon Sep 11 15:19:44 2023 daemon.info olsrd[12887]: Adding interface wg_51820
Mon Sep 11 15:19:45 2023 daemon.err olsrd[12887]: crash (logging a stack trace is not supported on this platform)
Mon Sep 11 15:19:46 2023 daemon.info olsrd[12887]: Writing '1' (was 0) to /proc/sys/net/ipv4/conf/switch0.30/send_redirects
Mon Sep 11 15:19:46 2023 daemon.info olsrd[12887]: Writing '1' (was 0) to /proc/sys/net/ipv4/conf/switch0.21/send_redirects
Mon Sep 11 15:19:46 2023 daemon.info olsrd[12887]: Writing '1' (was 0) to /proc/sys/net/ipv4/conf/switch0.20/send_redirects
Mon Sep 11 15:19:46 2023 daemon.info olsrd[12887]: Writing '1' (was 0) to /proc/sys/net/ipv4/conf/switch0.11/send_redirects
Mon Sep 11 15:19:46 2023 daemon.info olsrd[12887]: olsr.org - pre-0.9.9-git_0000000-hash_5ccaf6c8b903022374ea8a44065e0940 stopped
pktpls commented 1 year ago

Nur um Verwirrung vorzubeugen, Reload bedeutet hier Restart, weil Babel und OLSR keine dedizierten Reload-Actions haben.

Es wird die Dinge ziemlich sicher nicht schlechter machen - und kurze Aussetzer wenn OLSR neustartet finde ich erträglicher als die regelmäßigen dauerhaften Aussetzer.