aboutsummaryrefslogtreecommitdiff
path: root/net/mwan3/files/usr
Commit message (Collapse)AuthorAge
* mwan3: only send disconnected event if interface was connected beforeFlorian Eckert2022-10-17
| | | | | | | | Up to now on every interface down event a mwan3 disconnected event was send. This is wrong because if the interface was never connected, then a disconnected event should not get generated. This commit fixes this bug. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: move command definitions to common.shFlorian Eckert2022-03-14
| | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: add troublshoot command from LuCIFlorian Eckert2021-07-08
| | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: cleanup help outputFlorian Eckert2021-07-08
| | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: update ubus status for not tracked interfacesFlorian Eckert2021-05-03
| | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: add connecting and disconnecting event to mwan3trackFlorian Eckert2021-03-16
| | | | | | | | | | | | | If the interface goes into failure state (is disconnecting) then with this change one hotplug.d event is generated. The same is true for the recovery state (is connecting), when the interface comes back from a failure state. In both cases, a hotplug.d event for the iface is triggered. Once with the $ACTION=disconnecting and once for the $ACTION=connecting. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: disable DNS lookups for ping checksFlorian Eckert2021-03-01
| | | | | | | | | | | | | | | | | By default, ping does a reverse DNS of the IP that you are pinging. When you have a network issue (such as when a link has just gone down and you haven't yet marked it down), this lookup can cause failures on tests for links that are still good. This option only works for iputils ping. For busybox the option is not evaluated, but it is accepted without throwing an error. Fixes: #14968 Fixes: #14924 Signed-off-by: Florian Eckert <fe@dev.tdt.de> Suggested-by: David Lang <david@lang.hm>
* mwan3: fix regression in ipv6 routing tablesAaron Goodman2021-01-02
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: fix string check for active_tblsFlorian Eckert2020-12-22
| | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: add more error logging to routing functionsAaron Goodman2020-12-16
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: fix race condition in route loadingAaron Goodman2020-12-16
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: fix linkdown routes not being addedAaron Goodman2020-12-16
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: support latest iputils pingAaron Goodman2020-11-16
| | | | | | | | | | | iputils upstream changed build params with version s20200821 Latest OpenWRT iputils ping now appears to report the openwrt version tag, rather than iputils date tag This commit sends a test ping to localhost to evaluate the capabilities of iputils ping. Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: don't call rpcd on 'mwan3 interfaces'Aaron Goodman2020-11-16
| | | | | | | Allow `mwan3 interfaces` to get uptime via an internal function and thus remove the dependency on rpcd for `mwan3 interface` calls. Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: cleanup indenting in rpcd interface statusAaron Goodman2020-11-10
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: don't include output from TRACK_OUTUPUT in status callAaron Goodman2020-11-10
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: remove unused device lookup in status checkAaron Goodman2020-11-10
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: restore +x flag to mwan3 executablesAaron Goodman2020-11-10
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: make it clearer who initiated the startFlorian Eckert2020-11-06
| | | | | | | | | It was somewhat opaque how the variable a is questioned. To show this better the variable is now a string and not a boolean. So you can see directly what should happen. With a boolean you always have to think about what it means when 0 or 1 is used. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: use procd for locking everywhereAaron Goodman2020-11-06
| | | | | | | | | | | | | | | | | | | Replace locks on /var/run/mwan3.lock with locks via procd. This fixes a deadlock issue where mwan3 stop would have a procd lock, but a hotplug script would have the /var/run/mwan3.lock Locking can be removed from mwan3rtmon since: 1) procd will have sent the KILL signal to the process during shutdown, so it will not add routes to already removed interfaces on mwan3 shutdown and 2) mwan3rtmon checks if an interface is active based on the mwan3_iface_in_<IFACE> entry in iptables, and the hotplug script always adds this before creating the route table and removes it before deleting the route table Fixes github issue #13704 (https://github.com/openwrt/packages/issues/13704)
* mwan3: use common makefile install wrappersFlorian Eckert2020-11-06
| | | | | | | With this change you can see at a glance which files will be installed on the system. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: fix wait conditions in mwan3trackFlorian Eckert2020-11-06
| | | | | | | | Will only run when no events are pending. Signed-off-by: Aaron Goodman <aaronjg@stanford.edu> [ Update description and split into own commit ] Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: move mwan3_init call in mwwan3track into mainFlorian Eckert2020-11-06
| | | | | | | Initialize TRACK_OUTPUT has been set after INTERFACE variable initialization. Move definition into main fixes this issue. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: fix rpcd with for routers with no IPv6 supportAaron Goodman2020-10-29
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: do not wait to process ifup/ifdown eventsAaron Goodman2020-10-27
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: fix mwan3 route handlingAaron Goodman2020-10-27
| | | | | | | | | - support trailing route space from iproute2 - add routes even when iface is down - fix source_routing argument check - add quotes in logging to better detect issues with trailing spaces Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: fix mwan3 'use'Aaron Goodman2020-10-22
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: cleanup mwan3trackAaron Goodman2020-10-16
| | | | | | | | - reduce duplicate logging code - simplify nping track code - simplify ping result parsing Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: add back support for iputils pingAaron Goodman2020-10-16
| | | | | | | With the new wrapper code, we can override the broken binding behavior of iputils ping v20101006. Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: add "use" function to mwan3 utilsAaron Goodman2020-10-16
| | | | | | | | | | | | | | | Use "mwan3 use" to wrap a command with interface bindings so that you can avoid the mwan3 rules and test behavior on a specific interface. eg "mwan3 use wan ping -c1 1.1.1.1" Additional binding arguments to the command will have their system calls intercepted and ignored. eg "mwan3 use wan ping -c1 -I tun0 1.1.1.1" will use the device associated with "wan", rather than "tun0". Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: use helper library for mwan3trackAaron Goodman2020-10-16
| | | | | | | | | | | | | | | | | Rather than using a special mwan3 user to manage mwan3track's tracking packets, this commit implements a small helper library to bind to device and to set a fwmark so that the tracking packets can be routed out of the correct interface. This provides a consistent method for binding to a device rather than relying on various packages potentially buggy implementations. For example: #8139 and #12836 This helper issue also allows for more tracking methods to be added even if they do not have a command line option to bind to device, such as iperf3 (eg #13050). Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: use procd for mwan3rtmon and mwan3trackAaron Goodman2020-10-16
| | | | | | | | | | | start all mwan3mon and mwan3track instances on mwan3 start if an interface is down when mwan3track starts, it waits for a signal from the hotplug script to start procd can then handle stopping all of the scripts when mwan3 is halted Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: improvements to route creationAaron Goodman2020-10-16
| | | | | | | | | | | | | | | | | | handle creation of routing tables in mwan3rtmon to avoid race conditions and potentially missing routes handle ipv6 routes that have expiry update directly connected ipset when routes are added or deleted add fall through rules so that the default routing table is not used if no rule in the interface-specific routing table matches add option to comply with mwan3 source based routing get default route parameters from main routing table Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: use MWAN3TRACK_STATUS_DIR variable throughoutAaron Goodman2020-10-16
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: fixup some extra spaces and shellcheck warningsAaron Goodman2020-10-16
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: improve startup performance; version 2.9.0Aaron Goodman2020-08-17
| | | | | | | | | | | | | | | | | | | | | | improve startup and runtime performance by 1) moving common startup procedures out of hotplug script when called from mwan3 start 2) reducing calls to iptables to check status of rules 3) consolidating iptables updates and updating with iptables-restore 4) do not wait for kill if nothing was killed 5) running interface hotplug scripts in parallel 6) eliminate operations in hotplug script that check status on every single interface unnecessarily 7) consolidate how mwan3track makes hotplug calls 8) do not restart mwan3track on connected events This is a significant refactor, but should not result in any breaking changes or require users to update their configurations. version bump to 2.9.0 Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: use ip monitor route to detect routing changesAaron Goodman2020-08-15
| | | | | | | | | | | use only committed uci changes for updating routing table use functions.sh functions rather than uci command line tool to find interfaces for routing table. consolidate rtmon_ipv4 and rtmon_ipv6 functions into a single function Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* treewide: replace `which` with `command -v`Paul Spooren2020-08-09
| | | | | | | | | | Fix shellcheck SC2230 > which is non-standard. Use builtin 'command -v' instead. Once applied to everything concerning OpenWrt we can disable the busybox feature `which` and save 3.8kB. Signed-off-by: Paul Spooren <mail@aparcar.org>
* mwan3: remove lock file entirelyFlorian Eckert2020-07-28
| | | | | | Removing the lock file ist not necessary Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: fix race condition on mwan3 restartFlorian Eckert2020-07-28
| | | | | | | This adjustment of the locks fixes the race condition when a mwan3 hotplug script and a mwan3 command are running at the same time. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: don't try to use ipv6 if not installedAaron Goodman2020-07-19
| | | | | | fix issue #11826 Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: be more efficient with sleep after killing trackersAaron Goodman2020-07-16
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: Fix mwan3 start not doing anythingMichiel Blokzijl2020-07-03
| | | | | | | | | Due to a missing config load function call, mwan3 start runs ifup for an empty list of interfaces, thus not calling ifup at all. This commit introduces the missing config_load call. Signed-off-by: Michiel Blokzijl <code@m01.eu>
* mwan3: set status to unknown in rpcd if status file not foundFlorian Eckert2020-06-17
| | | | | | If the status file is not found then set then return the value unknown. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: Use /128 for ipv6 if no other source address was foundAaron Goodman2020-05-29
| | | | Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: force busybox pingAaron Goodman2020-05-22
| | | | | | | | | | | | | | | openwrt 19.07 uses iputils 20101006-1 This ancient version of iputils has a bug where the -I option is not respected. https://github.com/iputils/iputils/issues/55 https://github.com/iputils/iputils/issues/56 https://bugs.openwrt.org/index.php?do=details&task_id=1486 Thus, we should force using busybox ping at "/bin/ping" until the iputils version gets an upgrade in the next major release Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
* mwan3: Don't use /128 address for ping sourceBrian J. Murrell2020-04-30
| | | | | | | | An interface can have both a /64 and a /128 from a provider. In such a case, use the address from the /64 to do the ping check, not the /128. Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
* mwan3: fix whitespace issueFlorian Eckert2020-04-27
| | | | | | fixes #11965 Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mwan3: Ping IPv6 hosts using address not interfaceBrian J. Murrell2020-03-13
| | | | | | | | | | Pinging IPv6 hosts using an interface as a source specifier seems troublesome. See https://bugs.openwrt.org/index.php?do=details&task_id=2897 for more detail. Use the desired source interface's IP address instead. Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
* mwan3: add httping_ssl optionFlorian Eckert2019-11-14
| | | | | | | | Till now we could only ping http targets on port 80. With this change by adding the config boolean config option httping_ssl we could also ping https ping targets on port 443. Signed-off-by: Florian Eckert <fe@dev.tdt.de>