* interfaces_addresses() only request single interface data when there's only one interface requested
* interface_configure() mtu check only needs a specific interface, don't request all
get_cached_json_content() deserialize json data when the file is found and not yet expired, returns null otherwise.
Since there might be some spots in the code where this can be convenient, it seemed like a good idea to wrap it in a function within the legacy code base.
Maybe config.inc is not enterily the right spot for this, but util.inc is quite diverse already.
When there are a lot of interfaces, these calls consume quite some time and eventually the output of legacy_interfaces_details() is what matters to all of them.
We can't be sure this won't happen again since the code makes
no effort to avoid such scenarios and happily moves on. There's
probably more problematic code here down the line, but having
flushed out the other thing means we're on the right track.
So having changed get_real_interface() to not check edge cases
for existing interfaces has bubbled up this check to the caller
get_parent_interface() which in turn made the check global.
The problem is that get_parent_interface() ran a hypothentical
code path through get_real_interface() and subsequently now
fails for dailup types leaving an empty interface.
That in turn caused some other refactoring to break where
individual device functions would take an argument or reload
all interfaces. Now that dailup fiddles with get_parent_interface()
and overwrites the result of get_real_interface() in the main
interface_configure() run it would reconfigure previously
configured devices stripping their IP configuration in the
process.
Yikes! :)
PR: https://forum.opnsense.org/index.php?topic=13442.0
It's a short term solution, it would be better to refactor the legacy page and use configd calls, but since the "any" keyword wasn't possible in fbsd, it seemed like a good idea to allow multiple selections.
Changes in this commit:
- start tcpdump captures to files using /tmp/packetcapture_[INTERFACE].cap in stead of the single file before
- refactor "remove" action to delete all /tmp/packetcapture_*.cap
- refactor "view" action to iterate over all /tmp/packetcapture_*.cap files and return a named array per interface
- change download action to point to the actual filename and return content of found.
* Adds repository, origin and path attributes to the api endpoint (for future use)
* When the software is not provided by OPNsense, popup a dialog informing the user.
We should probably refactor a bit more here, and make a clearer distinction between repositories in the frontend, this will have to wait until 19.7 is out.
as discussed with @fichtner
`install' has the same issue as `upgrade' and maybe we need to be careful
about use of `-[pP]' so that we are not stuck with a hash that does not
invalidate when installing a new version anymore.