Skip to content

Minor cross-compilation fixes - #335

Open
dbnk0 wants to merge 5 commits into
masterfrom
minor_marmot_fixes
Open

dbnk0 wants to merge 5 commits into
masterfrom
minor_marmot_fixes

Conversation

@dbnk0

@dbnk0 dbnk0 commented Oct 23, 2026

Copy link
Copy Markdown

Summary

Four small fixes for building and running ipfixprobe on embedded or cross-compiled targets such as OpenWrt:

  • An opt-out for the QUIC plugin, which is the only reason OpenSSL is needed.
  • A configurable path to ur_processor.sh.
  • Build fixes for 32-bit platforms.
  • A fix in the TLS plugin, which allocated the wrong UniRec array.

The default build works as before.

Details

  • cmake: add ENABLE_PROCESS_QUIC option
    The QUIC process plugin is the only part of ipfixprobe that uses OpenSSL (to decrypt QUIC Initial packets). Because the plugin is always built, OpenSSL is a hard build and runtime dependency of the whole project. The new ENABLE_PROCESS_QUIC option defaults to ON. OpenSSL is only looked up when the option is on. This lets ipfixprobe be built for small devices that don't ship OpenSSL.

  • cmake: look up ur_processor.sh instead of hard-coding its path
    The UniRec field generator always ran from /usr/bin/nemea/ur_processor.sh on the build host. In cross builds the script is staged somewhere else, and the build host may not have Nemea installed at all. The script is now found with find_program(). /usr/bin/nemea stays as a search path, so existing setups keep working, and the location can be overridden with -DUR_PROCESSOR=<path>.

  • process: fix build on 32-bit targets
    On 32-bit targets, size_t is a different type from uint64_t and unsigned long, which breaks the build in two places:

    • tls_parser.cpp: quic_get_variable_length() takes the offset as uint64_t&, but parse_quic_user_agent() passed a size_t. The offset is now declared as uint64_t.
    • tls.cpp: std::min() was called with a size_t and a 99UL literal, so template argument deduction failed. It now uses std::min<size_t>.
  • tls: allocate the TLS_EXT_TYPE array before filling it
    RecordExtTLS::fill_unirec() allocated F_QUIC_TLS_EXT_TYPE but then filled F_TLS_EXT_TYPE. The allocation failed silently because that field isn't in the TLS template. ur_array_set() then grew the array one element at a time, moving the rest of the record on every element. The correct field is now allocated. The exported data doesn't change; only the needless reallocations go away.


✅ Checks

  • Relevant documentation was updated (if needed)
  • CI pipeline passes (build, tests, lint, static analysis)
  • New code follows clang-tidy rules
  • The change is clearly related to a specific issue / requirement
  • Documentation (e.g. Doxygen) is updated if needed
  • The PR is rebased on the latest master
  • No unrelated changes are included

dbnk0 added 4 commits October 23, 2026 15:25
The QUIC process plugin is the only part of ipfixprobe that uses
OpenSSL (to decrypt QUIC Initial packets), but it is always built, so
OpenSSL is a hard build and runtime dependency of the whole project.

Adds an `ENABLE_PROCESS_QUIC` option (default ON, so the default build
is unchanged) and look up OpenSSL only when the plugin is enabled. This
allows building ipfixprobe for small embedded devices without OpenSSL.
The UniRec field generator was always run from
/usr/bin/nemea/ur_processor.sh on the build host. In cross builds
(e.g. OpenWrt) the script is staged elsewhere and the build host may
not have Nemea installed at all.

Look the script up with find_program(), keeping /usr/bin/nemea as a
search path, so that the location can be overridden with
-DUR_PROCESSOR=<path>.
On 32-bit targets size_t is not the same type as uint64_t or unsigned
long, which breaks the build in two places:

- tlsParser: quic_get_variable_length() takes the offset as uint64_t&,
  but parse_quic_user_agent() passes a size_t, so the reference cannot
  bind. Declares the offset as uint64_t.
- tls: std::min() is called with a size_t and an unsigned long literal,
  so template argument deduction fails. Uses std::min<size_t> instead.
fill_unirec() allocates the QUIC_TLS_EXT_TYPE array instead of the
TLS_EXT_TYPE array that it fills afterwards. The allocation fails,
because the field is not part of the TLS template, and the array is
then grown by ur_array_set() one element at a time, which moves the
rest of the record on every element.

Allocates the TLS_EXT_TYPE array instead. The exported data does not
change.
@dbnk0
dbnk0 requested a review from SiskaPavel October 23, 2026 13:35
editorconfig-checker 4.0.0 renamed its binary from `ec` to
`editorconfig-checker`, so the check fails with "command not found"
since the unpinned image was updated.

Calls the binary by its new name and pins the image to major version 4,
so that future breaking releases do not break the CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant