Commit graph

218 commits

Author SHA1 Message Date
Florian Eckert
138d02cfcb mwan3: remove lock file entirely
Removing the lock file ist not necessary

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit ab747fe0fb)
2020-07-28 07:24:41 +02:00
Florian Eckert
520eeb0804 mwan3: revert: also cleanup lock on mwan3 stop
This reverts commit cde2a77ed3.

Applying this change has shown that it is even quicker to provoke the
race condtition on simultan mwan3 commands execution.
By reversing the change we have the same behaviour as before.

But the race condition on mwan3 execute at the same time still exists.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit b5bd6d757b)
2020-07-28 07:24:32 +02:00
Florian Eckert
294e7503b5 mwan3: fix race condition on mwan3 restart
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>
(cherry picked from commit 2dac1bcdc9)
2020-07-28 07:24:12 +02:00
Florian Eckert
5bfc1c9cfd mwan3: update version to 2.8.11
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit f601e6cfa4)
2020-07-27 12:20:46 +02:00
Florian Eckert
e02cac8152 mwan3: add online and uptime to detail output
Add also online time value and uptime time value from netifd to the
detail output view.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit b0acbf057e)
2020-07-27 12:20:37 +02:00
Florian Eckert
538d2fd7c3 mwan3: add workaround for procd change
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 058a2b6f30)
2020-07-27 12:20:27 +02:00
Florian Eckert
b340df6824 mwan3: also cleanup lock on mwan3 stop
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit cde2a77ed3)
2020-07-27 12:19:59 +02:00
Florian Eckert
b5ed0033c8 mwan3: fix rtmon routing table function generation
If the uci option family is not set in the interface section, then there
is no default value set as in the `config_load / config_get` API.
The problem here is that if the family is not set, the default value ipv4
is normaly assumed. But the comparison fails here because the value is empty
and therefore the dedicated routing table for this interface is not compared
with the other routes from the main table and so not updated.

To fix this set the default value for this config option which is`false`
for enabled and `ipv4` for family.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit bcd13ba95c)
2020-07-27 12:19:50 +02:00
Florian Eckert
2c89e14c31 mwan3: fix IPv6 routing add handling
This fixes routing handling. Introduced with the last version update.
The following message disappears on the shell
when mwan3 is called with 'mwna3 restart`.

`Error: Invalid gateway address.`

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[aaronjg@stanford.edu: fully unset variable and handle ipv4 as well]
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 8e3e6f8dde)
2020-07-27 12:19:41 +02:00
Florian Eckert
447d51edbf mwan3: fix idx calculation
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[aaronjg@stanford.edu: fix syntax error]
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit a796b7a84e)
2020-07-27 12:19:32 +02:00
Aaron Goodman
37e2f88208 mwan3: version bump
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit ca8bc3d115)
2020-07-27 12:19:21 +02:00
Aaron Goodman
b9e3461250 mwan3: cleanup duplicate ipv4 and ipv6 logic
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 30a46bdc9e)
2020-07-27 12:19:12 +02:00
Aaron Goodman
db46d3ab03 mwan3: don't send iptable setup failures to /dev/null
silencing failing rules makes debugging more difficult

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 702a104f9c)
2020-07-27 12:19:03 +02:00
Aaron Goodman
383555d076 mwan3: add default rule for ipv6 in example config
default rule only applied to ipv4 with dest_ip 0.0.0.0/0
and error was hidden when trying to apply it in ip6table

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 2a5e9be83e)
2020-07-27 12:18:52 +02:00
Aaron Goodman
dc25b38f13 mwan3: don't try to use ipv6 if not installed
fix issue  #11826

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit a0d66d4eeb)
2020-07-27 12:18:40 +02:00
Aaron Goodman
ec45ff8052 mwan3: be more efficient with sleep after killing trackers
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 84a53b7c79)
2020-07-27 12:18:29 +02:00
Aaron Goodman
d6b051b8c0 mwan3: don't add single ipv4 to connected list if already covered by a cidr
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit da9a626f78)
2020-07-27 12:18:18 +02:00
Florian Eckert
f834ba0fce mwan3: update version to 2.8.9
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 2594258c4b)
2020-07-27 12:18:00 +02:00
Florian Eckert
2f2044ecb0 mwan3: cleanup function mwan3_create_iface_route
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit d0c248a7da)
2020-07-27 12:17:51 +02:00
Florian Eckert
db3c8326fe mwan3: fix shellcheck warning SC2086
Add double quote to prevent globbing and word splitting where there is
no regression.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit feae9e5742)
2020-07-27 12:17:40 +02:00
Florian Eckert
7d0f2cdb63 mwan3: fix shellcheck warning SC2166
Replace -o boolean check with ||.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit c0fdfaa174)
2020-07-27 12:17:31 +02:00
Florian Eckert
c0b111feab mwan3: remove unused variable complained by shellcheck
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 644d9a25df)
2020-07-27 12:17:22 +02:00
Florian Eckert
3443eb3c7d mwan3: fix shellcheck warning SC2039
Replace all `==` with `=`.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 0ed7524f81)
2020-07-27 12:17:11 +02:00
Florian Eckert
be8f287aaa mwan3: move redirect error output to trash
This suppress the following output on `mwan3 restart`:
> Dump terminated

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit facf8ea299)
2020-07-27 12:17:01 +02:00
Michiel Blokzijl
86d2bfe022 mwan3: Fix mwan3 start not doing anything 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>
(cherry picked from commit acfbd98ce0)
2020-07-06 08:58:45 +02:00
Florian Eckert
b74d5e9c17 mwan3: update version to 2.8.7
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 8030814267)
2020-07-06 08:58:45 +02:00
Florian Eckert
4f394c2590 mwan3: set status to unknown in rpcd if status file not found
If the status file is not found then set then return the value unknown.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit e30f16beef)
2020-07-06 08:58:45 +02:00
Florian Eckert
f7749c663b mwan3: switch to procd init script
This enables the procd handling for mwan3 on config change.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit a6dc75428c)
2020-07-06 08:58:45 +02:00
Aaron Goodman
0498a2b357 mwan3: address reviewer comments on 5147dfc7
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 38be40843b)
2020-07-06 08:58:45 +02:00
Aaron Goodman
cc1bb3e8b9 mwan3: Use /128 for ipv6 if no other source address was found
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 4efaa44b21)
2020-07-06 08:58:45 +02:00
Aaron Goodman
74b6f10845 mwan3: Allow user to specify rules based on source interface
Add an option for adding rules based on source interface.
The default 0.0.0.0/0 src and destination ip addresses has been removed. It is unclear
how the 'any' family of rules would have worked, as it appears each rule always required an
ipv4 or ipv6 address src and destination address.  With this change, the any family will work
again.

I also cleaned up a bunch of repeated code around adding the iptables rules for
ipv4/ipv6/any in making the change.

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 5147dfc73a)
2020-07-06 08:58:45 +02:00
Aaron Goodman
c14e74a5a8 mwan3: Do not mangle outgoing ipv6 pings
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit cf38136b00)
2020-07-06 08:58:45 +02:00
Aaron Goodman
465baa46c3 mwan3: version bump to 2.8.6
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit b7d1f81f10)
2020-07-06 08:58:45 +02:00
Aaron Goodman
19bebd3d89 mwan3: force busybox ping
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>
(cherry picked from commit 35a86bdc11)
2020-07-06 08:58:45 +02:00
Aaron Goodman
ffce45e365 mwan3: don't add ipv6 link local address to routing tables
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit aafdd0730c)
2020-07-06 08:58:45 +02:00
Aaron Goodman
a3c399d01f mwan3: reduce calls to `ip route list'
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
(cherry picked from commit 02ebd831c1)
2020-07-06 08:58:45 +02:00
Brian J. Murrell
4af28cc681 mwan3: Update Makefile
Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
(cherry picked from commit b017fe34dd)
2020-07-06 08:58:45 +02:00
Brian J. Murrell
0693f0c9e3 mwan3: Don't use /128 address for ping source
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>
(cherry picked from commit 49cf5eac5c)
2020-07-06 08:58:45 +02:00
Florian Eckert
0d795d2028 mwan3: fix whitespace issue
fixes #11965

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 3c34b151f6)
2020-04-28 17:10:32 +02:00
Brian J. Murrell
b7959a8d38 mwan3: Ping IPv6 hosts using address not interface
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>
(cherry picked from commit 6721587e8b)
2020-04-28 17:10:32 +02:00
Florian Eckert
2ac0a05d6c mwan3: change license to SPDX compatible identifier
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 6d638c3e23)
2020-04-28 17:10:32 +02:00
Florian Eckert
928ac2a20a mwan3: update version to 2.8.2
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 14dd084662)
2020-04-28 17:10:32 +02:00
Florian Eckert
1ea75a8fa5 mwan3: add httping_ssl option
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>
(cherry picked from commit a689e168aa)
2020-04-28 17:10:32 +02:00
Florian Eckert
c2cd3f0997 mwan3: fix variable naming
The variable IPT is not valid at this point. Set the variable usage to IPT4
fixes this issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 581d7df844)
2020-04-28 17:10:32 +02:00
Florian Eckert
0f67fc96d8 mwan3: sync PKG_RELEASE number and PKG_VERSION with master
Since the merge of the luci master branch into the luci openwrt.19.07 branch,
the ubus API was not in sync anymore. So all commits from the master
branch where backported into the openwrt-19.07 branch. But this could
not be done linear. There were already some fixes cherry-picked from the
master and the version does not match anymore. This commit syncronized
the PKG_VERSION and the PKG_RELEASE again to make clear that the
version in master and openwrt-19.07 are even again and have so the
same software version until to this commit.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-11-15 09:59:09 +01:00
Daniel A. Maierhofer
62c9688adc mwan3: Add missing IPs to wanb
Maintainer: Florian Eckert @feckert
Compile tested: not needed
Run tested: x86_64

Description:
Only two of the four IPs defined for wan are found in wanb, adding it so it is the same.

Signed-off-by: Daniel A. Maierhofer <git@damadmai.at>
(cherry picked from commit 1e97156adc)
2019-11-15 09:57:20 +01:00
Florian Eckert
aa5a583869 mwan3: update version to 2.8.0
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit e100de8bd8)
2019-11-15 09:56:29 +01:00
Florian Eckert
e842ea3941 mwan3: add netifd up info to mwan3 ubus status output
Add the netifd up status output to the mwan3 ubus status output.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 27db561752)
2019-11-15 09:51:50 +01:00
Florian Eckert
f20b96e4a5 mwan3: add enabled info to mwan3 ubus status
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit cfba93a203)
2019-11-15 09:49:39 +01:00
Florian Eckert
0c25f7a51c mwan3: add interface uptime netifd value to ubus mwan3 status output
Add missing netifd uptime info to ubus status call.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit bfa849c14e)
2019-11-15 09:40:15 +01:00