-
-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(icmp) support DoNotFragment + Size #633
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
@@ -38,6 +38,7 @@ Have any feedback or questions? [Create a discussion](https://github.com/TwiN/ga | |||
|
|||
|
|||
## Table of Contents | |||
- [Table of Contents](#table-of-contents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Table of Contents](#table-of-contents) |
README.md
Outdated
|
||
|
||
### Conditions | ||
Here are some examples of conditions you can use: | ||
|
||
| Condition | Description | Passing values | Failing values | | ||
|:---------------------------------|:----------------------------------------------------|:---------------------------|------------------| | ||
| :------------------------------- | :-------------------------------------------------- | :------------------------- | ---------------- | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you revert this & other similar changes?
client/config.go
Outdated
// Df set for the client | ||
Df bool `yaml:"df"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does Df
mean? DoFragment
?
Could you clarify that in the comment?
Ah that's my markdown auto format in my vscode, I'll revert. |
Should be better now. I'm not sure if this is really a feature that should be added to Gatus, but it doesn't cost much to add it. |
q:q!
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this file has been added by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, fixed !
README.md
Outdated
| `client.df` | Option to set the DoNotFragement bit for ICMP packet | `false` | | ||
| `client.size` | Size of the ICMP packet | `25` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'In hindsight, maybe this should be under icmp
, i.e.
client:
icmp:
df: true
size: 25
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done, as you said, it makes more sense that way
Co-authored-by: TwiN <[email protected]>
client/config.go
Outdated
// Size of the packet | ||
Size int `yaml:"size"` | ||
type ICMPConfig struct { | ||
DF bool `yaml:"df"` // Don't Fragment flag used for the ICMP client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DF bool `yaml:"df"` // Don't Fragment flag used for the ICMP client | |
DF bool `yaml:"df"` // Don't Fragment flag used for the ICMP client |
client/config.go
Outdated
c.Icmp = &Icmp{ | ||
Df: false, | ||
c.ICMPConfig = &ICMPConfig{ | ||
DF: false, | ||
Size: 25, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've set this configuration because it's the only way I've found to make it work.
But maybe I'm missing something in Go.
I did the tests by validating with network captures:
- A classic linux ping can have a data of 0.
- If I don't specify a Size or defaultSize by default the Size is 24.
So you are right I can remove defaultSize = 24
But then, If I don't specifiy anything in icmp in my yaml file, the ping is not working.
That's why I put this code with the Size in it.
// If Icmp is nil, let's initialize it with default values
c.ICMPConfig = &ICMPConfig{
DF: false,
Size: 24,
}
But maybe this is not the good way to initialise it.
If I test with a Size <24 it doesn't work either.
I notice that this limitation exists in other tools that use pro-bing
For example
https://github.com/SuperQ/smokeping_prober
Packetdata size in bytes. Default 56 (Range: 24 - 65535)
That's why I put
if c.ICMPConfig != nil {
// limit for pro-ping, below 24 it's not working
if c.ICMPConfig.Size < 24 {
c.ICMPConfig.Size = 24
}
And my mistake: the limit is 24, not 25.
Summary
It's really a network-related need.
We use Gatus for temporary tests and we need to do MTU validation.
This pull request adds 2 capabilities to ICMP:
This will my issue #506
Example of configuration with these options:
Checklist
README.md
, if applicable.