Skip to content

Minor compilation fixes - #1116

Open
GabrielGanne wants to merge 10 commits into
appneta:4.6.1-beta1from
GabrielGanne:compilation-fixes
Open

Minor compilation fixes#1116
GabrielGanne wants to merge 10 commits into
appneta:4.6.1-beta1from
GabrielGanne:compilation-fixes

Conversation

@GabrielGanne

Copy link
Copy Markdown
Contributor
  • The PR title is descriptive.
  • The PR doesn't replicate another PR which is already open.
  • The code is mine or it's from somewhere with an MIT-compatible license.
  • The code is efficient, to the best of my ability, and does not waste computer resources.
  • The code is stable and I have tested it myself, to the best of my abilities.
  • The code passes sudo make test

Changes:

This PR should only contain changes that have no functional impact, and only either fix compilation with some specific configuration option, or with some additional warnings enabled.
Those warnings were found while working on compiling with meson and trying to add warning_level=3.

Since they are all rather small, I'm submitting them in a single PR, but please feel free to pick or reject any number of them or request a separate PR if you prefer.

@fklassen
fklassen changed the base branch from master to 4.6.1-beta1 August 2, 2026 02:43
@fklassen

fklassen commented Aug 2, 2026

Copy link
Copy Markdown
Member

I targeted the latest branch and now I have conflicts. Please resolve.

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
It was included by default, but in a conditional block that force-xdp
option can cause to disable.

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
__func__ is the standard since c99, it should be safe to use.

This silences some pedantic warnings like this one:
> ISO C does not support ‘__FUNCTION__’ predefined identifier

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
This silences warning:
> warning: ISO C forbids zero-size array ‘dummy’

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
"x?: y" is a gnu extension that behaves almost the same as "x? x : y".
The difference being that x can be evaluated twice, but here this should
not change anything. In addition to silencing a warning, I find that
I'm more used to this syntax which is easier to read.

This silences warning:
> warning: ISO C forbids omitting the middle term of a ‘?:’ expression

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
Assisted-by: Claude Opus 4.8
Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
This is to silence warning:
> warning: ISO C forbids ‘return’ with expression, in function returning void

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
* replace all timeval with timespec structures continuing the work of
  commit [1]
* rename all "usec" -> "nsec" for coherency (commit [1]): struct timespec
  have replaced struct timeval. Those are nanosecond precision.
* fix configure help string: "timestamp-trace" -> "enable-timestamp-trace"

Note that if timestamp-trace is enabled, there's already a tcpreplay
test with pps option enabled that will dump a meaningful trace and act
as a smoke test for the feature.

Refs:
[1] 3b0934e

Fixes: 3b0934e
Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
SP_TYPE_SOCK_RAW is always defined

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
This adds HAVE_LIBXDP as a terminal backend in the injection chain

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
@GabrielGanne

GabrielGanne commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

I rebased over branch 4.6.1-beta1 and removed one commit about ubsan that you already fixed.

For ref, the commit was GabrielGanne@503ccf5
Your fix for the same issue is 314e489
It does indeed fix the ubsan issue and is smaller, but causes some address-of-packed-member warnings to appear.
Eg.

../src/tcpedit/edit_packet.c:246:24: warning: taking address of packed member of ‘struct tcpr_icmpv4_hdr’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  246 |         csum_replace16(&icmp->icmp_sum, old, new);

I' not sure anyone really cares about these warnings anymore since most HW support this now, but it's still worth noting.

From what I can tell, the other commits are still relevant (no other commit in the beta branch tries to address the same issue)

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.

2 participants