Commit graph

208 commits

Author SHA1 Message Date
Florian Eckert
a796b7a84e 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>
2020-07-19 23:24:13 -04:00
Aaron Goodman
ca8bc3d115 mwan3: version bump
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-07-19 23:24:13 -04:00
Aaron Goodman
30a46bdc9e mwan3: cleanup duplicate ipv4 and ipv6 logic
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-07-19 23:24:13 -04:00
Aaron Goodman
702a104f9c 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>
2020-07-19 23:18:22 -04:00
Aaron Goodman
2a5e9be83e 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>
2020-07-19 23:18:21 -04:00
Aaron Goodman
a0d66d4eeb mwan3: don't try to use ipv6 if not installed
fix issue  #11826

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-07-19 23:18:18 -04:00
Aaron Goodman
84a53b7c79 mwan3: be more efficient with sleep after killing trackers
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-07-16 02:03:21 -04:00
Aaron Goodman
da9a626f78 mwan3: don't add single ipv4 to connected list if already covered by a cidr
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-07-16 02:03:21 -04:00
Florian Eckert
2594258c4b mwan3: update version to 2.8.9
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-07-15 10:23:47 +02:00
Florian Eckert
d0c248a7da mwan3: cleanup function mwan3_create_iface_route
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-07-15 10:23:47 +02:00
Florian Eckert
feae9e5742 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>
2020-07-15 10:22:26 +02:00
Florian Eckert
c0fdfaa174 mwan3: fix shellcheck warning SC2166
Replace -o boolean check with ||.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-07-15 10:21:54 +02:00
Florian Eckert
644d9a25df mwan3: remove unused variable complained by shellcheck
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-07-15 10:21:54 +02:00
Florian Eckert
0ed7524f81 mwan3: fix shellcheck warning SC2039
Replace all `==` with `=`.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-07-15 10:21:54 +02:00
Florian Eckert
facf8ea299 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>
2020-07-15 10:21:54 +02:00
Michiel Blokzijl
acfbd98ce0 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>
2020-07-03 20:03:42 +01:00
Florian Eckert
8030814267 mwan3: update version to 2.8.7
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-06-17 13:04:38 +02:00
Florian Eckert
e30f16beef 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>
2020-06-17 13:01:49 +02:00
Florian Eckert
a6dc75428c 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>
2020-06-17 13:00:48 +02:00
Aaron Goodman
38be40843b mwan3: address reviewer comments on 5147dfc7
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-06-13 15:29:32 -04:00
Aaron Goodman
4efaa44b21 mwan3: Use /128 for ipv6 if no other source address was found
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-05-29 09:44:20 -04:00
Aaron Goodman
5147dfc73a 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>
2020-05-29 09:42:29 -04:00
Aaron Goodman
cf38136b00 mwan3: Do not mangle outgoing ipv6 pings
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-05-29 01:24:57 -04:00
Aaron Goodman
b7d1f81f10 mwan3: version bump to 2.8.6
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-05-22 20:01:49 -04:00
Aaron Goodman
35a86bdc11 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>
2020-05-22 20:01:45 -04:00
Aaron Goodman
aafdd0730c mwan3: don't add ipv6 link local address to routing tables
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-05-20 05:37:40 -04:00
Aaron Goodman
02ebd831c1 mwan3: reduce calls to `ip route list'
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-05-20 05:37:39 -04:00
Brian J. Murrell
b017fe34dd mwan3: Update Makefile
Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
2020-04-30 14:55:20 +02:00
Brian J. Murrell
49cf5eac5c 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>
2020-04-30 14:55:20 +02:00
Florian Eckert
3c34b151f6 mwan3: fix whitespace issue
fixes #11965

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-04-27 17:58:12 +02:00
Brian J. Murrell
6721587e8b 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>
2020-03-13 15:24:57 +01:00
Florian Eckert
6d638c3e23 mwan3: change license to SPDX compatible identifier
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-11-18 09:26:51 +01:00
Florian Eckert
14dd084662 mwan3: update version to 2.8.2
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-11-14 08:01:52 +01:00
Florian Eckert
a689e168aa 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>
2019-11-14 07:57:11 +01:00
Florian Eckert
581d7df844 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>
2019-11-14 07:57:11 +01:00
yurtesen
94e0c78826 mwan3: Fix json_load fails with some data
Sometimes the return value of `ubus -S call network.interface.wan status`
cause `json_load` to return `Failed to parse message data` error.

To avoid this, the JSON data always should be quoted with double quotes.

Signed-off-by: Evren Yurtesen <eyurtese@abo.fi>
Removed quoatation marks from commit heading
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-11-14 07:43:18 +01:00
Daniel A. Maierhofer
1e97156adc 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>
2019-08-04 18:47:25 +02:00
Florian Eckert
e100de8bd8 mwan3: update version to 2.8.0
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-04 12:06:27 +02:00
Florian Eckert
27db561752 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>
2019-07-04 12:03:43 +02:00
Florian Eckert
cfba93a203 mwan3: add enabled info to mwan3 ubus status
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-04 12:03:40 +02:00
Florian Eckert
bfa849c14e 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>
2019-07-04 12:03:37 +02:00
Florian Eckert
6c2cd78c6f mwan3: rename downtime to offline
Rename downtime ubus output from mwan3 to offline.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-04 12:03:34 +02:00
Florian Eckert
3be40786f5 mwan3: rename uptime to online
Rename uptime ubus output from mwan3 to online.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-04 12:03:30 +02:00
Florian Eckert
8d3c8dadcf mwan3: add migration script for flush_conntrack config
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-07-04 12:03:23 +02:00
Florian Eckert
171cb17694 mwan3: change flush_conntrack handling to use uci list element
With this change it is now possible to combine interface action events.
If an interface action is generated by netifd or mwan3 for example ifup,
ifdown, connectd or disconnected and this action is configured in the inteface
uci section, then the conntrack table is flushed by mwan3.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-06-03 14:16:05 +02:00
Chen Minqiang
a004d07632 mwan3: fix logical/typo bug in mwan3rtmon
This bug was introduced since dd206b7d0b
mwan3_remon_ipv4 and mwan3_remon_ipv6 is command to run not a variable
I add some comments on them hopefully people will notice it

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2019-03-22 18:11:07 +08:00
Florian Eckert
27e7e88966 mwan3: fix disconnected event generation in mwan3track
Before this change two disconnected events were generated. This is wrong!
The disconnected event is impliciet generated by the hotplug script on ifdown
event. The mwan3track script is notified by a USR1 signal which
generates the disconnectd event. The additional "disconnectd" event on
ifdown is not required.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-02-27 13:50:51 +01:00
Florian Eckert
7b4c075cc2 mwan3: update version to 2.7.10
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-01-22 14:29:34 +01:00
Florian Eckert
2ff9c8ecb7 mwan3: add locking debug possibility
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-01-22 14:29:04 +01:00
Florian Eckert
d167e3718d mwan3: lock critical section on mwan3 down
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-01-22 14:29:01 +01:00