Skip to content

feat: add error packet handling.#61

Merged
Romero027 merged 1 commit intoappnet-org:mainfrom
deskchen:main
Jan 22, 2026
Merged

feat: add error packet handling.#61
Romero027 merged 1 commit intoappnet-org:mainfrom
deskchen:main

Conversation

@deskchen
Copy link
Copy Markdown
Contributor

This pull request enhances error packet handling in both the proxy and proxy-buffer components, ensuring error packets are correctly detected, processed, forwarded, and tested. The changes introduce a dedicated method for error packet processing, improve routing information propagation, and add comprehensive tests for error packet serialization, deserialization, and validation.

Error Packet Handling Improvements:

  • Added a ProcessErrorPacket method to PacketBuffer in both cmd/proxy/buffer.go and cmd/proxy-buffer/buffer.go, enabling direct processing and forwarding of error packets without fragmentation. This method constructs a BufferedPacket with full routing information. [1] [2]
  • Updated the handlePacket logic in both cmd/proxy/main.go and cmd/proxy-buffer/main.go to detect error packets by their type ID, process them using the new method, and forward them directly to the intended peer, bypassing the element chain. [1] [2]

Error Packet Routing and Serialization:

  • Modified SendErrorPacket in cmd/proxy/util/send_packet.go and cmd/proxy-buffer/util/send_packet.go to include source and destination IP/port fields in error packets, ensuring accurate routing information is preserved and transmitted.
  • Updated all usages of SendErrorPacket to pass the new routing parameters. [1] [2]

Testing Enhancements:

  • Added extensive tests for error packet serialization/deserialization, MTU validation, and the new error packet handling logic in both cmd/proxy/main_test.go and cmd/proxy/buffer_test.go. These tests verify correct field propagation, error detection, and boundary conditions. [1] [2]

Other Changes:

  • Set the default log level to "debug" in cmd/proxy/main.go to aid in development and troubleshooting.
  • Added missing imports for the packet package where required. [1] [2]

These changes collectively improve the reliability and observability of error handling in the proxy system, ensuring error packets are robustly managed and tested.

@deskchen deskchen requested a review from Romero027 January 22, 2026 00:51
@Romero027 Romero027 merged commit 4f60282 into appnet-org:main Jan 22, 2026
1 check passed
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