rpki-client: rework aspa_insert_vaps()
The merge loop in aspa_insert_vaps() is too smart and has tripped us all up
repeatedly. While it won't matter much due to size constraints, its worst
case is O(n*m), which isn't great.
Let's make this easier to follow and reason about. A linear sweep merges
and deduplicates the two arrays question until one of them is consumed,
then fill in the tail of the one that remains non-empty. Both arrays are
strictly monotonic, and this property is clearly preserved by the new
approach.
The other bit that is obvious is that the merge loop is O(n + m). The price
we pay is a bit more code and an extra allocation.
ok claudio job
In tlv_decode_fec_elm add missing initial len and prefixlen check
Ensure that fec_elm have at least the one byte needed for the type
and also check that the encoded prefixlen actually matches with the
address family.
Reported by Yang Hailong
OK deraadt@ tb@
add an openssl flavor for nginx so that the main package can be used with openssl
the subpackages will not have an openssl flavor, so they can use either of
the -main packages, however since the debug flavor affects the modules as
well, hack around that by specifying FULLPKGPATH and FULLPKGNAME manually
additionally rename the headers-more subpackage to headers_more to avoid
the flavored package name change (from sthen@)
ok and input fromsthen@
cherrypick upstream patches that fix memory leaks with json_object_put()
tracked down by Peteris Lazdins after seeing a BIND memory leak when
using the json stats channel.
cherrypick upstream patches that fix memory leaks with json_object_put()
tracked down by Peteris Lazdins after seeing a BIND memory leak when
using the json stats channel.
rpki-client: fix merging of ASPA objects
Prompted by a question by Yangyang WANG, draft-ietf-sidrops-aspa-profile-29
added new wording regarding 0 handling when merging two ASPAs with the same
customer ASID and clarified that 0 should be discarded:
https://mailarchive.ietf.org/arch/msg/sidrops/TToTScyLiVXdyJzf-kgzv5XMy3U/
Implement this and adjust the accounting when dropping the 0.
Found by job because this case now appears in the wild.
ok claudio
stop checking for if_type == IFT_IEEE8023ADLAG everywhere.
trunk no longer overwrites the if_type on ports, so it's not going
to be IFT_IEEE8023ADLAG.
in particular this fixes packet reception on trunk interfaces.
found by and fixed tested by landry@
restore port interface function state in a better order.
removing the ether_port before fixing the if_ioctl pointer, and
especially when doing ioctls in between those two things, trips
KASSERTS.
bug reported and fix tested by landry@
Sync with ometric from rpki-client: Sort union by size
The initalizers introduced in C99 may only initialize the first
element of a union. If that one is not the largest member
then you may end up with uninitalized memory. In the end the
outcome depends on the compiler used which is just bananas.