Commit Graph

11 Commits (master)

Author SHA1 Message Date
Michele Guerini Rocco a2ebb61cec
Release v0.3 2023-06-18 02:06:53 +02:00
Michele Guerini Rocco 601a8f08d3
Add README.md 2023-06-18 02:06:53 +02:00
Michele Guerini Rocco 880b12b62a
Update copyright information 2023-06-18 02:04:58 +02:00
Michele Guerini Rocco ac7097727a
Allow to run as non-root 2023-06-18 02:04:58 +02:00
Michele Guerini Rocco f5bff09ffe
Fix undefined behavior
Returning a pointer to a static buffer in an object that is later
deleted results in an empty IP header, depending on the compiler and
optimisation level.
Instead we can write directly inside the packet buffer.
2023-06-18 02:04:57 +02:00
Michele Guerini Rocco 8182ef4335
Create ICMP packets containing valid IP and UDP data
The encapsulated IP packed was missing source/destination addresses and
the UDP datagram had size 0.
2023-06-18 02:04:57 +02:00
Michele Guerini Rocco e17b206b83
Fix invalid use of inet_ntoa
inet_ntoa returns a pointer to a fixed buffer.
If called multiple times during the evaluating of an expression the
buffer will be overwritten and the addresses will appear duplicated.
2023-06-18 02:04:57 +02:00
Michele Guerini Rocco 940af5a896
Get the actual local address, not 0.0.0.0
The sockets are bound on all interfaces using INADDR_ANY, so getsockname
always return 0.0.0.0.
The actual address can be obtained from the destination address of the
received IP packet using the socket ancillary data.
2023-06-18 02:04:57 +02:00
Michele Guerini Rocco c7f3f9df4e
Fix incorrect logical expression 2023-06-18 02:04:57 +02:00
Michele Guerini Rocco 533868b21e
Fix standard C++ 11 issues 2023-06-18 02:04:57 +02:00
Michele Guerini Rocco 6a18c72b0c
initial commit 2023-06-18 02:04:56 +02:00