Skip to content

Fixes for several bugs#17

Merged
gsnw-sebast merged 2 commits intomainfrom
fix-2026-03
Mar 29, 2026
Merged

Fixes for several bugs#17
gsnw-sebast merged 2 commits intomainfrom
fix-2026-03

Conversation

@gsnw-sebast
Copy link
Copy Markdown
Contributor

Improved error handling, resource leaks, and robustness

  • fcntl F_GETFL/F_SETFL: Check return values, propagate result
  • Fixed FD leak in dgram_bind_and_get_id: call close(fd) on error
  • dgram_bind_and_get_id: Option → Result<Option, io::Error>
  • build_icmp_packet: kind parameter enabled, ICMPv6 RAW checksum TODO added
  • recv_ping: Separate ICMP type checking for IPv4 and IPv6
  • recv_ping: Distinguish EAGAIN/WouldBlock from actual errors
  • parse_icmp_packet: I/O and packet parsing moved to a separate function
  • ICMP offsets as named constants (no more magic numbers)
  • Source IP validation: TODO comment added

@gsnw-sebast gsnw-sebast merged commit 252651e into main Mar 29, 2026
2 checks passed
@gsnw-sebast gsnw-sebast deleted the fix-2026-03 branch March 29, 2026 06:19
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