summaryrefslogtreecommitdiff
path: root/main.c
Commit message (Collapse)AuthorAgeFilesLines
* netifd: Do not return values in void functionHauke Mehrtens2023-02-191-1/+2
| | | | | | These two functions return void, do not try to return a parameter. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* netifd: Fix multiple -Wsign-compare warningsHauke Mehrtens2023-02-191-2/+2
| | | | | | | | | | | | | | | | | | This fixes warnings like this: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Mostly this was an int compared to a size_t returned by ARRAY_SIZE(). The easiest fix is to count on the size_t type. The ifindex is sometimes an unsigned int and sometimes a signed int in the kernel interfaces. I think it normally fits into an unsigned 16 bit value, so this should be fine. Do the one comparison where the compiler complains as a long. Casting the result of sizeof() to int should be safe. These values are never out of range of int. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* main: fix hotplug script usage messageStijn Tintel2021-11-231-1/+1
| | | | | | | | | Commit 41842d3f9173 introduced a new command line option, and its usage message was added in between the two lines of the hotplug script usage message. Move both lines back together. Fixes: 41842d3f9173 ("add some code for keeping track of dns servers ...") Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* main: poll process log stream even if processes are killedFelix Fietkau2021-09-291-1/+1
| | | | | | Ensures that pending log messages are still received Signed-off-by: Felix Fietkau <nbd@nbd.name>
* extdev: add support for external device handlersArne Kappen2021-03-311-0/+2
| | | | | | | | | | This allows to integrate external daemons that configure network devices with netifd. At startup, netifd generates device handler stubs from descriptions in /lib/netifd/extdev-config via the mechanism in handler.c. These are then added to the list of device handlers. Device handlers stubs act as relays forwarding calls against the device handler interface to the external daemon. Signed-off-by: Arne Kappen <arne.kappen@hhi.fraunhofer.de>
* netifd: propagate error code on netifd_reload()Alexandru Ardelean2017-04-051-2/+2
| | | | | | | | | | | | | | | The context is that we generate some of the UCI config for netifd via scripts/programs. Every once in a while, there's a goof when doing that UCI generation, and netifd prints out the error at stderr, but returns 0 (success) err-code. This change will fail the ubus call if UCI config is invalid or missing for /etc/config/network. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
* main: remove redundant error check in netifd_start_processFelix Fietkau2015-10-291-3/+0
| | | | | | Detected by Coverity CID 1329378 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: process reload calls immediately instead of going through a timerFelix Fietkau2014-06-111-10/+5
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* uci: Allow setting the UCI config path on the command lineMatthias Schiffer2014-03-191-1/+6
| | | | | | | Add a -c switch which allows setting an alternative UCI path instead of using the libuci default. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* proto-shell: defer init until after command line option processingFelix Fietkau2014-03-071-0/+2
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* wireless: defer init until after command line option processingFelix Fietkau2014-03-071-0/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* Work around warn_unused_result in recent gcc/libcSteven Barth2014-02-161-1/+1
|
* netifd: fix process stdin/stdout/stderr when the pipe fds overlap with ↵Felix Fietkau2013-12-011-5/+12
| | | | | | standard fds Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* utils: add a function for checking if a process given by pid is still aliveFelix Fietkau2013-10-221-1/+0
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* log: fix processing of incomplete linesFelix Fietkau2012-12-291-1/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* fix container_of for the log ustreamFelix Fietkau2012-10-301-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* move uloop_process_delete call to get rid of an unnecessary checkFelix Fietkau2012-10-301-2/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* log: the ustream notify_state callback is now optional, remove the stubFelix Fietkau2012-10-301-5/+0
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* use ustream for process message loggingFelix Fietkau2012-10-291-65/+34
|
* use FD_CLOEXEC instead of tracking lists of fdsFelix Fietkau2012-10-291-25/+4
|
* fix a file descriptor leakFelix Fietkau2012-05-131-0/+1
|
* add copyright headersFelix Fietkau2012-05-041-0/+13
|
* simplify log buffer handlingFelix Fietkau2012-03-191-6/+6
|
* fix log buffer splittingFelix Fietkau2012-03-191-5/+9
|
* fix log buffer overflow handlingFelix Fietkau2012-03-191-1/+1
|
* always use SIGKILL for netifd_kill_process, it is usually a last resortFelix Fietkau2012-01-211-1/+1
|
* in log read, check for EINTR instead of EAGAIN to avoid infinite loopsFelix Fietkau2011-10-211-1/+1
|
* try to grab log data more aggressivelyFelix Fietkau2011-10-201-1/+1
|
* fix segfaults in log line processingFelix Fietkau2011-10-201-3/+7
|
* reduce stack usageFelix Fietkau2011-10-201-1/+1
|
* rename config_init_interfaces to config_init_allFelix Fietkau2011-10-191-2/+2
|
* remove the argument to config_init_interfacesFelix Fietkau2011-10-191-2/+2
|
* move log levels to netifd.hFelix Fietkau2011-10-191-8/+0
|
* fix interrupted read checks in log collectionFelix Fietkau2011-10-181-3/+5
|
* fix infinite loop in logging when the logged process diesFelix Fietkau2011-10-161-1/+5
|
* add support for a user-configurable log levelFelix Fietkau2011-10-161-5/+33
|
* add support for logging messages via syslog (or optionally stdout)Felix Fietkau2011-10-161-3/+39
|
* detach stdin/stdout/stderr from child processes, implement a separate ↵Felix Fietkau2011-10-161-5/+102
| | | | logging pipe and relay log messages with prefix
* add support for tracking open file descriptors of modules and closing them ↵Felix Fietkau2011-10-151-0/+23
| | | | for created child processes
* move netifd_start_process dir_fd to the data structureFelix Fietkau2011-10-151-3/+3
|
* when killed, kill pending child processesFelix Fietkau2011-10-151-0/+31
|
* keep track of all running child processes in one placeFelix Fietkau2011-10-151-0/+55
|
* add some code for keeping track of dns servers and search domains and for ↵Felix Fietkau2011-10-111-1/+6
| | | | writing resolv.conf
* use /lib/netifd as main path when dummy mode is disabledFelix Fietkau2011-10-091-1/+1
|
* add support for calls to a hotplug script on interface state changesFelix Fietkau2011-10-071-0/+5
|
* rework debugging code, add debugging levelsFelix Fietkau2011-10-041-1/+6
|
* add a ubus call for triggering config reloadsFelix Fietkau2011-10-031-4/+14
|
* add a system_init function for system controlSteven Barth2011-09-231-0/+6
|
* fix compilation with GCC 4.6 on LinuxSteven Barth2011-09-221-1/+2
|
* bring all interfaces down on restartFelix Fietkau2011-09-111-0/+2
|