Skip to content

Conversation

@rgerhards
Copy link
Member

Summary

  • extend engine and TCP structures to track client source port
  • add relpEngineSetSyslogRcv3 API that passes hostname, IP, and port
  • invoke new callback when available

Testing

  • make -j$(nproc)
  • make check

https://chatgpt.com/codex/tasks/task_e_68bbf884f07483328ee2e5a0af8b9c1a

gemini-code-assist[bot]

This comment was marked as outdated.

@rgerhards rgerhards requested a review from Copilot September 6, 2025 11:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends the RELP library to provide client source port information to callback functions. It adds a new relpEngineSetSyslogRcv3 API that includes the client's port number along with hostname and IP address.

  • Add pRemHostPort field to TCP structure to track client source port
  • Implement new relpEngineSetSyslogRcv3 callback API with port parameter
  • Update internal logic to extract and store port information from socket addresses

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tcp.h Add pRemHostPort field to store client source port
src/tcp.c Extract port from socket address and manage memory allocation
src/scsyslog.c Invoke new callback with port parameter when available
src/relp.h Add onSyslogRcv3 callback function pointer to engine structure
src/relp.c Implement new API function and dummy callback
src/librelp.h Export new relpEngineSetSyslogRcv3 API function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rgerhards rgerhards force-pushed the codex/analyze-api-client-name/ip-retrieval branch from 9de3b00 to 7097c7d Compare September 6, 2025 15:01
Copy link

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

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 adds a new callback to expose the client's source port, which is a useful enhancement. The implementation looks mostly correct.

My main concern is with the error handling in src/tcp.c where the getnameinfo() call is updated. The new error handling is less robust than the previous version and could lead to issues if getnameinfo() fails. I've left a specific comment with a suggestion to fix this.

Additionally, there are several formatting changes throughout the pull request, mainly replacing tabs with spaces for indentation. This makes the diff harder to read and introduces style inconsistencies. It would be great if these formatting changes could be reverted to keep the focus on the logical changes and maintain a consistent coding style across the project.

@rgerhards rgerhards force-pushed the codex/analyze-api-client-name/ip-retrieval branch from 7097c7d to 84b29ed Compare September 6, 2025 15:19
This is handled via a new "on connection callback"
@rgerhards rgerhards force-pushed the codex/analyze-api-client-name/ip-retrieval branch from 84b29ed to 9a7d8bf Compare September 6, 2025 15:28
@rgerhards rgerhards self-assigned this Sep 6, 2025
@rgerhards rgerhards marked this pull request as ready for review September 6, 2025 15:36
@rgerhards rgerhards merged commit fdf90a0 into master Sep 6, 2025
12 of 13 checks passed
@rgerhards rgerhards deleted the codex/analyze-api-client-name/ip-retrieval branch September 6, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants