10808 Commits

Author SHA1 Message Date
Ad Schellevis
41b318e13a Routing, gateways. add group functions to new gateway class, for https://github.com/opnsense/core/issues/2279 2019-04-16 13:34:32 +02:00
Ad Schellevis
118acc33e5 routing, gateways. In gateway groups you could originally select a vip, which isn't used in our system. orgininally this came from ab1112da4c
Let's remove it while working on https://github.com/opnsense/core/issues/2279
2019-04-15 18:59:13 +02:00
Ad Schellevis
1feaa21fe4 Routing, gateways - groups. regression in https://github.com/opnsense/core/issues/2279 , since "interface" contains the configured value now, we should use "if". 2019-04-15 18:39:02 +02:00
Ad Schellevis
a2aba45eb7 Routing, gateway_groups, don't hide gateways on edit, which keeps presentation on new/edit equal. Previously you could have a group, containing an item that didn't exist anymore (interface removed), in which case you needed to remove the group to be able to edit it. related to https://github.com/opnsense/core/issues/2279 2019-04-15 18:27:25 +02:00
Björn Kalkbrenner
e9cb9c0862 dhcp: added TFTP bootfile-name (fix for #3074, introduced with 8e361f3051aa) (#3420) 2019-04-15 17:27:23 +02:00
Ad Schellevis
497f523f6e Routing, gateways. When gathering gateway status from dpinger, don't consider dpinger endpoints down if not yet available. This could lead to some unexpected gateway switches. for https://github.com/opnsense/core/issues/2279
We might consider another status for "startup", although since we report loss and delay as "~" it should already be obvious that we don't know the status yet.
2019-04-15 16:48:49 +02:00
Ad Schellevis
1a55473032 Filter, add ipv6-icmp type selection, closes https://github.com/opnsense/core/issues/3412 2019-04-15 14:54:19 +02:00
Ad Schellevis
6f6486dc8e Routing, gateways. don't consider lo0 as a default gateway candidate. Since it doesn't make much sense to send all traffic to localhost, we better exclude it to keep the previous behaviour. for https://github.com/opnsense/core/issues/2279 2019-04-15 12:59:57 +02:00
Ad Schellevis
b4d8a49678 Routing, gateways. log gateways that are not being considered, https://github.com/opnsense/core/issues/2279 2019-04-15 12:51:23 +02:00
Ad Schellevis
dd8d3444f5 Routing, gateways. The /tmp/*_defaultgw construction has a race condition the way it is implemented now. for https://github.com/opnsense/core/issues/2279
It is used by dhcp client to detect if a default route might be overwritten and it determines default gateway priority. Since I don't want to refactor the dhclient-script at the moment, we best keep the file, but remove the "default" detection.
So system_default_route() sets the file, which dhclient can pickup when a new gateway is propagated.
2019-04-15 11:25:58 +02:00
Ad Schellevis
6101ba8940 sysct, remove duplicates. closes https://github.com/opnsense/core/issues/3410 2019-04-15 09:32:33 +02:00
Ad Schellevis
0edd562429 Fitler, firewall_rules.php, descr already escaped. closes https://github.com/opnsense/core/issues/3418 2019-04-15 09:17:38 +02:00
Ad Schellevis
45a4d2b4b8 Revert "Filter, "no translation address with matching address family found" fix for https://github.com/opnsense/core/issues/2841"
This reverts commit 971df3c4bfae40a982f670ffbe932b7013faf9db.
2019-04-14 16:36:50 +02:00
Ad Schellevis
971df3c4bf Filter, "no translation address with matching address family found" fix for https://github.com/opnsense/core/issues/2841
This might have side affects, stupid thing is that in some situations :network doesn't appear to yield this error (e.g. openvpn:network), although I'm also not 100% it does work when not raising any errors.
Now we validate if there's a matching address for the ip protocol requested, otherwise it will disable the rule (and log in the /tmp/rules.debug file about it)
2019-04-14 15:12:50 +02:00
Ad Schellevis
bfca97e2e0 Routing, gateways. minor regression in getDefaultGW() we should only return a gateway with an address as default here. for https://github.com/opnsense/core/issues/2279 2019-04-14 14:41:21 +02:00
Ad Schellevis
e053087280 Routing, gateways. temporrary disable adding tunnel endpoints for https://github.com/opnsense/core/issues/2279 2019-04-14 14:36:38 +02:00
Ad Schellevis
7a8b12f030 Routing, gateways. naming for https://github.com/opnsense/core/issues/2279 as discussed 2d3e6de0de 2019-04-14 11:31:39 +02:00
Franco Fichtner
c20a25b21b system: gwlb.inc will be dpinger.inc some day
Start using correct prefixes in obvious functions.
2019-04-13 19:38:22 +02:00
Ad Schellevis
c4d42929fb Routing, gateways. missed two statements where friendlyiface was used, since we keep the configured "interface", these need to be renamed. for https://github.com/opnsense/core/issues/2279 2019-04-13 17:35:34 +02:00
Ad Schellevis
2d3e6de0de Routingm, gateways. what's in a name, discussed in https://github.com/opnsense/core/issues/2279 with @mimugmail 2019-04-13 17:31:28 +02:00
Ad Schellevis
4cc7157d78 Routing, gateways. now that get_interface_gateway_v6() and get_interface_gateway() are unused, ditch duplicate these duplicates. for https://github.com/opnsense/core/issues/2279 2019-04-13 17:28:29 +02:00
Ad Schellevis
c69e1f0b6b Routing, gateways. there's no need to try to retrieve the gateway address twice in return_gateway_groups_array(), our gateway class already resolved the address. for https://github.com/opnsense/core/issues/2279 2019-04-13 17:26:25 +02:00
Ad Schellevis
ac239827d4 Routing, gateways. replace get_interface_gateway() in get_interfaces_info() for https://github.com/opnsense/core/issues/2279 2019-04-13 17:20:45 +02:00
Ad Schellevis
18cd8b8e58 Routing, gateways. replace get_interface_gateway() in interface_6to4_configure() for https://github.com/opnsense/core/issues/2279 2019-04-13 17:17:33 +02:00
Ad Schellevis
2011da3800 Routing, gateways. replace get_interface_gateway() in interface_6rd_configure() for https://github.com/opnsense/core/issues/2279 2019-04-13 17:16:22 +02:00
Ad Schellevis
be85768f6b Routing, gateways. interface_gif_configure() replace get_interface_gateway() with new class implementation, reverted previous patch (misread the target interface). for https://github.com/opnsense/core/issues/2279 2019-04-13 17:12:18 +02:00
Ad Schellevis
5c4da8687d Revert "Route, gateways. prevent possible race in interface_gif_configure(), (host route not created on first execution) and remove get_interface_gatewayXXX usage. for https://github.com/opnsense/core/issues/2279"
This reverts commit 0c1f95b9b3f24625a29b788b5d74c9ce858c609b.
2019-04-13 17:03:24 +02:00
Ad Schellevis
26291b7fcd Routing, gateways. make sure we don't return an invalid gateway (property could be set to 'dynamic') in Gateway class, for https://github.com/opnsense/core/issues/2279 2019-04-13 16:35:28 +02:00
Ad Schellevis
0c1f95b9b3 Route, gateways. prevent possible race in interface_gif_configure(), (host route not created on first execution) and remove get_interface_gatewayXXX usage. for https://github.com/opnsense/core/issues/2279 2019-04-13 16:20:15 +02:00
Ad Schellevis
aacd319511 Route, gateways. in filter.lib.in:filter_core_get_initialized_plugin_system() replace get_interface_gatewayXXX with new object call, for https://github.com/opnsense/core/issues/2279 2019-04-12 20:56:26 +02:00
Ad Schellevis
f39eb0b86a Route, gateways. add getInterfaceGateway() to Gateways class to find the most likely gateway for a named interface (lan, wan, ..) for https://github.com/opnsense/core/issues/2279 2019-04-12 20:08:36 +02:00
Ad Schellevis
d9f0e03a28 Firewall/live-log, stop poller on error. closes https://github.com/opnsense/core/issues/3409 2019-04-12 19:04:43 +02:00
Ad Schellevis
9be62b07f9 Routing, gateways. system_routing_configure() should use the exact same method to determine "default" as evrything else, removes quite some obscure hooks and duplicated logic. definitely needs additional testing, for https://github.com/opnsense/core/issues/2279 2019-04-12 18:47:21 +02:00
Ad Schellevis
10a858855b Route, gateways. remove return_gateways_array(), replaced with new gateways class. for https://github.com/opnsense/core/issues/2279 2019-04-12 18:13:29 +02:00
Ad Schellevis
446ba20cce Routing, gateways. ditch refactor return_gateway_groups_array() to use the new gateways class, for https://github.com/opnsense/core/issues/2279 2019-04-12 18:03:57 +02:00
Ad Schellevis
c67b276bf9 gateway monitoring, don't report perfect when unknown, closes https://github.com/opnsense/core/issues/3408
and ditch return_gateways_array() usage for https://github.com/opnsense/core/issues/2279
2019-04-12 17:26:41 +02:00
Ad Schellevis
2b03a9be13 Gateways, change "pending" to "~" in https://github.com/opnsense/core/issues/3408 2019-04-12 17:13:46 +02:00
Ad Schellevis
af2b31bd7a gateway status widget, align status and color to system_gateways.php, for https://github.com/opnsense/core/issues/3408 2019-04-12 17:12:26 +02:00
Ad Schellevis
58a2efd4f9 Routing, gateways. use new gateways class in setup_gateways_monitor() and do some minor cleanups.
* monitor field is the responsibility of the class, so there's no need to check it again (duplicate)
* interface was previously overwritten with technical name, which is now in "if" field, replace occurrences
* simplify reasons to ignore gateways a bit (if, elseif block on top of loop)

for https://github.com/opnsense/core/issues/2279
2019-04-12 16:13:02 +02:00
Ad Schellevis
ace8f9af7f Routing, gateways. without consumers, its safe to kill lookup_gateway_interface_by_name, for https://github.com/opnsense/core/issues/2279 2019-04-12 15:54:52 +02:00
Ad Schellevis
e0e4ec5c08 Routing, gateways. refactor rc.openvpn. Although its still an ugly piece of software, its more clean now and uses the new gateways class required for https://github.com/opnsense/core/issues/2279
- since rc.openvpn can only be called from configd and accepting 1 parameter, it doesn't make sense to accept more than that
- in theory, this could accept a gateway group, but its not possible to monitor a gateway group, which does seem to make this a useless option
- if the parameter is not found [empty, all], it will start openvpn_resync_if_needed() for all interfaces.

I'm even not sure we need what's left of it, but it looks more sane now.

@fichtner please double check if this makes sense
2019-04-12 15:37:15 +02:00
Ad Schellevis
45297924e9 Routing, gateways. extend Gateways class with getInterface() to return technical interface and getInterfaceName() to return its name, for https://github.com/opnsense/core/issues/2279 2019-04-12 15:35:06 +02:00
Ad Schellevis
73ee4446d5 Routing, gateways. ditch now used lookup_gateway_ip_by_name() for https://github.com/opnsense/core/issues/2279 2019-04-12 15:06:19 +02:00
Ad Schellevis
49388ca2c6 Routing, gateways. ditch lookup_gateway_ip_by_name() usage from firewall_rules_edit.php, for https://github.com/opnsense/core/issues/2279 2019-04-12 15:05:07 +02:00
Ad Schellevis
bb1f0151d6 Routing, gateways. ditch lookup_gateway_ip_by_name() usage from system_resolvconf_generate() in system.inc, for https://github.com/opnsense/core/issues/2279 2019-04-12 14:56:29 +02:00
Ad Schellevis
a6340f8032 Routing, gateways. add getAddress() method to return a gateways address. for https://github.com/opnsense/core/issues/2279 2019-04-12 14:53:03 +02:00
Ad Schellevis
21f3607085 unused var, ref https://github.com/opnsense/core/issues/2279 2019-04-12 14:30:08 +02:00
Ad Schellevis
0c31965f27 Routing, gateways. replace return_gateways_array() with new class implementation in filter_delete_states_for_down_gateways, use empty() in stead of !isset(), our default config has <kill_states/> in it. for https://github.com/opnsense/core/issues/2279 2019-04-12 14:21:39 +02:00
Ad Schellevis
e9ba128993 Routing, gateways. replace return_gateways_array() in system_staticroutes_configure, for https://github.com/opnsense/core/issues/2279 2019-04-12 12:17:24 +02:00
Ad Schellevis
45c01a61ba Routing, gateways. move return_gateways_array() out of the way in DHCPvX relay services and prevent gatewaysIndexedByName() to be called multiple times in the loop, for https://github.com/opnsense/core/issues/2279 2019-04-12 12:07:02 +02:00