schweikert / fping

High performance ping tool
https://fping.org
Other
1.01k stars 250 forks source link

Add --fwmark option for Linux #289

Closed deepkv closed 8 months ago

deepkv commented 8 months ago

This is based on tomangert's original outdated pull request.

--fwmark can be used in conjunction with ip rule and ip route to route ping packets based on the mark set by the aforementioned flag.

This has been supported by Linux since kernel version 2.6.25

Let me know if you'd like any changes.

coveralls commented 8 months ago

Coverage Status

coverage: 81.69% (+0.1%) from 81.581% when pulling c0cdb524cee32c58bf4c4ed15368e2b7c44d9b40 on deepkv:develop into a3f4c573bfd1ddfc71d2fa672f51c41047473a53 on schweikert:develop.

schweikert commented 8 months ago

Thanks for your contribution!

Could you add a simple test to check at least that the program doesn't crash when --fwmark is passed? Pinging 12.0.0.7 is fine, and you don't need to check that the fwmark was actually set (that would be hard to do).

Also, please update doc/fping.pod (the man-page).

deepkv commented 8 months ago

Thanks for the review! Done.

deepkv commented 8 months ago

Apologies, it looks like setcap doesn't work in GitHub CI, which made the test fail. I've now used sudo instead. I believe it should work now.

deepkv commented 8 months ago

Update: the tests finally pass in GitHub CI in my repo after a couple more iterations. Thanks for your patience.