Second try: retain attribute values as sibling nodes with
a name up front. If the sibling does not exist fail silently
like before. At least from testing this no longer produces
any shift in the config.xml between string nodes with attributes.
Test XML:
<?xml version="1.0"?>
<opnsense>
<staticroutes version="1.0.0"/>
<someotherthing version="1.0.0">
<foo/>
</someotherthing>
<thing version="1.0.0"></thing>
<alias version="1.0.0"/>
<doesthisdoit></doesthisdoit>
</opnsense>
Test PHP:
<?php
require_once 'config.inc';
OPNsense\Core\Config::getInstance()->fromArray(load_config_from_file('foo.xml'));
print_r(OPNsense\Core\Config::getInstance()->__toString());
Result XML:
<?xml version="1.0"?>
<opnsense>
<staticroutes version="1.0.0"/>
<someotherthing version="1.0.0">
<foo/>
</someotherthing>
<thing version="1.0.0"/>
<alias version="1.0.0"/>
<doesthisdoit/>
</opnsense>
We need to make sure both the local and the remote IP belong to
the same CIDR range, which might not be the case if we just
calculate the subnet size required by their direct distance.
Rewrite find_smallest_cidr() to take an array of IPs to calculate
their smallest shared subnet mask. Code is actually pretty simple
and fast. However, we are not going to account for network and
broadcast address reservation unless that turns out to be an issue.
In the IPv6 case assume that /64 is a good approximation of the
result.
Remove code cruft in utilities while at it also replacing a simple
function only called once in setaddr.sh.
commit 9da181580631e305cf194688479eb311d74dda9d
Author: Ad Schellevis <ad@opnsense.org>
Date: Tue Aug 31 13:22:39 2021 +0200
CARP: small cleanups after https://github.com/opnsense/core/pull/5184
commit 9875b53e98aeed173e1603182251b8e2165cabbb
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 22:28:03 2021 +0300
CARP: Fix fetching VIP status
Implement array safeguards after e44fd48
commit 9c6ff1717741ec7f21a1b88127c57ff3d849085d
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 22:23:25 2021 +0300
CARP: Fix fetching VIP status
Simplify code after e44fd48
commit 52ffd6ee3d471c09a69599a8fdd02f6e6ea6f2c6
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 22:19:26 2021 +0300
CARP: Fix fetching VIP status
Simplify code after e44fd48
commit d5ae42623e31138daa29debedc36088fa7ba4811
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 22:13:57 2021 +0300
CARP: Fix fetching VIP status
Simplify code after e44fd48
commit df99ba8106233a34732bb0cb39f6134d7697e4a4
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 16:39:57 2021 +0300
CARP: Fix fetching VIP status
Take into account translation issues
commit 45eddeb399b64e631e7d81be8ac29dc2cad97bf2
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 16:35:04 2021 +0300
CARP: Fix fetching VIP status
Take into account translation issues
commit a068f10cd0a4402e648a09027a6b48b90670e60a
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 15:08:51 2021 +0300
CARP: Fix fetching VIP status
Whitespace cleanup
commit aa958e1d04938b084a5582dd4080988aef240eaa
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 15:05:12 2021 +0300
CARP: Fix fetching VIP status
Remove unnecessary require_once call
Co-authored-by: Franco Fichtner <franco@lastsummer.de>
commit 5966d1c834fe5c69845a675f0f829ec6efcabc2f
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 15:04:47 2021 +0300
CARP: Fix fetching VIP status
Remove unnecessary require_once call
Co-authored-by: Franco Fichtner <franco@lastsummer.de>
commit 38d6d952084ed2db4ae2d81aa583850a38f2f7b2
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 15:03:57 2021 +0300
CARP: Fix fetching VIP status
Remove unnecessary require_once call
Co-authored-by: Franco Fichtner <franco@lastsummer.de>
commit 3ae8a2f960310b4f373fbae3e77e2eea2b7ced8a
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 14:49:46 2021 +0300
CARP: Fix fetching VIP status
Eliminate calling get_carp_interface_status() by openvpn.inc
commit bf195f3a66ad6a1ec5c62ecb589e32681eeb86dc
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 14:04:16 2021 +0300
CARP: Fix fetching VIP status
Refactor the widget to call ifconfig once
commit 26bfe2036a846824b9d163d9c3c8aafd2be3ac36
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 13:58:20 2021 +0300
CARP: Fix fetching VIP status
Refactor the status page to call ifconfig once
commit 7cdc8eca63acfb9db8da9cf621780c30454df132
Author: vnxme <46669194+vnxme@users.noreply.github.com>
Date: Sun Aug 29 10:22:05 2021 +0300
CARP: Fix fetching VIP status
Add a space after vhid to make grep more precise
since the indexes themselves aren't used, it should be safe to change the current list interpretation into a named one, this would ease operations like https://github.com/opnsense/core/pull/5184
* Remove the unset-after-write-before-redirect logic of dhcpd on
WAN that practically does nothing.
* At least since b6b3a5ad1d6c41 interface_bring_down() does not
tamper with down flag of the interface avoiding the need to
set the up flag to fix "VLAN" (multiple times).
* Remove debug output that I have never seen before. The function
call below will throw an error too if that is even possible.
commit 46e0383625acfa59e723c390d0b5b2feed8a53aa
Author: Ad Schellevis <ad@opnsense.org>
Date: Mon Aug 23 11:05:53 2021 +0200
Firewall / Log - Live log : support rfc5424 format for https://github.com/opnsense/core/pull/5175
commit 0cf3030724d02181991436b324fe5fc70118d4d5
Author: Ad Schellevis <ad@opnsense.org>
Date: Sat Aug 21 09:36:56 2021 +0200
System logging - switch local logging to rfc5424 format.
Allow custom destinations to choose for rfc5424. closes https://github.com/opnsense/core/issues/4911
commit a46e39bcecca6dab1d5a68a0e7f481ea42c16034
Author: Ad Schellevis <ad@opnsense.org>
Date: Fri Aug 20 18:23:22 2021 +0200
System logging - switch local logging to rfc5424 format.
add severity filter to api and log pages
commit b0f38003d7745a01202ffca5e7b5b697ff211f1e
Author: Ad Schellevis <ad@opnsense.org>
Date: Fri Aug 20 15:42:58 2021 +0200
System logging - switch local logging to rfc5424 format.
Split BaseLogFormat into a generic LogFormat and a child NewBaseLogFormat to be able to support both property and method based parsers to keep (external) plugins compatible.
commit 264513f148185faf4a4509bc19aa35739c9844f9
Author: Ad Schellevis <ad@opnsense.org>
Date: Thu Aug 19 19:56:19 2021 +0200
System logging - switch local logging to rfc5424 format.
Refactor log parser (BaseLogFormat), since the plugins use this as well we might have to undo a bit or refactor those as well.