Skip to content

net-test: pacetkdrill: (Acc)ECN: avoid conflicts with kernel UAPI - #103

Closed
matttbe wants to merge 1 commit into
google:masterfrom
matttbe:tcp-h-conflict-AccECN
Closed

matttbe wants to merge 1 commit into
google:masterfrom
matttbe:tcp-h-conflict-AccECN

Conversation

@matttbe

@matttbe matttbe commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

All these '#define' are now part of the kernel UAPI, and cause conflict when netinet's tcp.h file has them defined there as well, e.g.

tcp.h:132:9: error: 'TCP_ACCECN_ACE_FAIL_SEND' redefined [-Werror]
  132 | #define TCP_ACCECN_ACE_FAIL_SEND        BIT(0)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/netinet/tcp.h:245:9: note: this is the location of the previous definition
  245 | #define TCP_ACCECN_ACE_FAIL_SEND        0x1
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

Conditionally set all these #define if they are not already defined to continue to support environments where they are not set. A single #ifndef would be enough, but it looks better to have a check per block not to mess-up with the comments and avoid potential confusions.

Fixes: 9ee1eb4 ("net-test: pacetkdrill: Add ecn_mode, AccECN status, and tcpi_option2 in tcpi")

All these '#define' are now part of the kernel UAPI, and cause conflict
when netinet's tcp.h file has them defined there as well, e.g.

  tcp.h:132:9: error: 'TCP_ACCECN_ACE_FAIL_SEND' redefined [-Werror]
    132 | #define TCP_ACCECN_ACE_FAIL_SEND        BIT(0)
        |         ^~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/netinet/tcp.h:245:9: note: this is the location of the previous definition
    245 | #define TCP_ACCECN_ACE_FAIL_SEND        0x1
        |         ^~~~~~~~~~~~~~~~~~~~~~~~

Conditionally set all these '#define' if they are not already defined to
continue to support environments where they are not set. A single
'#ifndef' would be enough, but it looks better to have a check per
block not to mess-up with the comments and avoid potential confusions.

Fixes: 9ee1eb4 ("net-test: pacetkdrill: Add ecn_mode, AccECN status, and tcpi_option2 in tcpi")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request wraps several TCP ECN and Accurate ECN macro definitions in gtests/net/packetdrill/tcp.h with #ifndef preprocessor guards to prevent redefinition conflicts. There are no review comments, and I have no feedback to provide.

@nealcardwell

Copy link
Copy Markdown
Collaborator

Thanks! I fixed a typo in the commit title and extended the Fixes SHA1 to be 12 characters, and merged here:

2a8b4d8

@matttbe

matttbe commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

I fixed a typo in the commit title

Thank you! Funny, I blindly copy-pasted it from the 'Fixes' commit :)

net-test: pacetkdrill: Add ecn_mode, AccECN status, and tcpi_option2 in tcpi

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