Check return code of uloop_run() and pass the signal number up when the
loop was interrupted. After cleanup, uninstall uloop's signal handlers
and re-raise the signal to terminate the process.
This allows interrupting the autoupdater using Ctrl-C during downloads,
instead of having it continue with the next mirror (if multple are
configured). As uloop's signal handlers only set a flag to interrupt
uloop_run() and have otherwise no effect, the autoupdater can still only
be interrupted during HTTP requests, ensuring we can't leave the system
in an inconsistent state.
uloop_run() may finish without ever reaching request_done(), for example
when the main loop is interrupted by a signal. In this case,
uclient_disconnect() was never called, leaving a number of callbacks
like timeout handlers registered in the uloop context.
When the main loop was later resumed in a subsequent HTTP request without
completely reinitializing the uloop context, these timeout handlers could
still fire, even though the old uclient context had already been freed,
resulting in a use-after-free.
To avoid this, move the uclient_disconnect() call out of request_done()
to ensure that it is always called before uclient_free().
sse-multiplexd leaked pipe FDs to its child processes, so newer children
kept the older ones alive when they should have received a SIGPIPE already.
Closesfreifunk-gluon/gluon#2468
Ignore a mismatching minor compat-version. A minor version hints an
incompatibility with configuration, which Gluon re-generates based on
the intent on upgrade. Thus, only mismatching major versions present
a reason to block installation.
This is required to provide a migration path from swconfig to DSA based
ethernet architectures.
Signed-off-by: David Bauer <mail@david-bauer.net>
This ID is meaningless outside of a node itself, it is not necessarily
stable across reboots and upgrades, and there is nothing else in the
respondd data that this ID could be matched against. Remove it.
This reverts commit 8d53ff54e5 ("respondd-module-airtime: add idx").
Let sysupgrade run a --test upgrade to verify that the image is
compatible before attempting an upgrade.
This fixes an issue where a router can get stuck without network
connectivity when a a remote autoupgrade was triggered.
Fixes#193
X-FIRMWARE-VERSION gets set to the content of the file referenced by UCI setting "autoupdater.settings.version_file"
If "autoupdater.settings.version_file" is unset X-FIRMWARE-VERSION is
omitted
In case a radio exists, but is disabled, the survey request will return
successfully, but without data.
The code could not handle this case, as the newest_element_index would
be negative in this case, leading to json_object_array_get_idx returning
a null-pointer.
Check for a null pointer prior adding the PHY index, avoiding a
null-pointer dereference.
Signed-off-by: David Bauer <mail@david-bauer.net>
If an autoupdater long option (prefixed with '--') are unknown then a segmentation fault occurs.
Example:
root@node:~# autoupdater --xyz
Segmentation fault
[Matthias Schiffer: changed sentinel syntax]
* include bugfix to allow sending unicast packets to neighbours
* FIX crash due to wrong format string
* FIX packet forwarding on mesh devices added via socket
* allow to build statically
* avoid adding mesh interfaces multiple times
This renames batman-adv.ko to batman-adv-legacy.ko. And also moves
scripts to a "-legacy" variant to avoid build errors when both
batman-adv and batman-adv-legacy are selected. Finally, moves the
batman-adv-legacy config to /etc/config/batman-adv-legacy.
This allows to select and install the batman-adv mainline and
batman-adv-legacy simultaneously.
Instead of unconditionally loading this module on boot the gluon_bat0
netifd protocol script will later take care of loading either the batman-adv
or batman-adv-legacy module, depending on the configured routing
algorithm in UCI.