Skip to content
Snippets Groups Projects
Unverified Commit b3a41a6e authored by Sami Kerola's avatar Sami Kerola
Browse files

ping: move global variables to runtime config structure


Primary reason to do this change is to make it clear when a variable is
local, and when it is originating to runtime state -- that is basically the
former global variables.  Aim is to make code a lot cleaner, easier to work,
and lower mental strain when needing to debug ping.

Secondly having a state structure available will allow many follow up
improvements, such moving all allocations to state and make clean up routine
at exit to work without need to get back to main() to free resources.  With
quick look other improvements could include some IPv4 / IPv6 code
deduplications, and possibly moving from sigaction() to signalfd() and event
loop.  But we'll see what happens in future.

Signed-off-by: default avatarSami Kerola <kerolasa@iki.fi>
parent 0101dd7d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment