Skip to content

feat: Add support for passing arbitrary ping options (config & command line)#29

Open
kazubu wants to merge 2 commits into
upa:masterfrom
kazubu:feat/ping-option
Open

feat: Add support for passing arbitrary ping options (config & command line)#29
kazubu wants to merge 2 commits into
upa:masterfrom
kazubu:feat/ping-option

Conversation

@kazubu

@kazubu kazubu commented Jun 3, 2026

Copy link
Copy Markdown

Adds a mechanism to pass arbitrary ping options through two paths:

  • Config file (per-target): specify per target via pingopt=
  • Command line (all targets / per IP version): -o / --ping-options-v4 / --ping-options-v6

This makes it possible to flexibly pass ping options such as packet size (-s)
or any other options depending on the target or IP version.

Usage

Config file (per-target)

Since the config splits tokens by whitespace, options are given as
comma-separated tokens:

googleDNS-bigpkt   8.8.8.8   pingopt=-s,1000,-w,2

Command line

# Common to all targets
./deadman -o="-s 1472" deadman.conf

# Separate options for IPv4 / IPv6
./deadman --ping-options-v4="-s 1472" --ping-options-v6="-s 1452" deadman.conf

Because the value starts with -, use the = form on the command line.

Order of application

Options are concatenated onto the ping command in this order:

common (-o)  →  per IP version (--ping-options-v4 / -v6)  →  per-target (config pingopt=)

Changes

  • Add a pingopt argument to Ping / PingTarget, and inject the options when
    building the ping command in Ping.async_send() (dispatching v4/v6 via Ping.ipversion)
  • Add a pingopt= key to the config parser (gettargetlist), splitting the
    comma-separated value into tokens
  • Add the -o/--ping-options, --ping-options-v4, and --ping-options-v6
    command-line arguments
  • Document the usage with examples in deadman.conf

Notes

  • These options apply to regular ICMP ping (including via SSH / netns / vrf).
    The tcp / snmp / routeros_api paths do not use the ping command, so
    they are out of scope.

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