Skip to content
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

Invalid IPProtocol value handling in chooseProtocol #1057

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ties
Copy link

@ties ties commented Apr 12, 2023

As a user, we got bitten by our configuration containing ipv6 instead of ip6 (and ipv4). As a result, our probes to an IPv6 only host failed. This was harder to debug than expected because we did not understand why the probe defaulted to ip_protocol=ip4 when we configured it for IPv6.

There are multiple ways of fixing this. I thought the clear local improvement was to:

  • default to IPv6 when the value is unknown
  • log that the default value was unknown - the log line ends up in the output of the potentially failed probe attempt.

I realise that this is technically a breaking change because the behaviour on an invalid value changes from ip4 to ip6. Further work would be to reject invalid values when parsing the configuration, but that would be a real breaking change.

Test that chooseProtocol defaults to IPv6 for empty, and unknown values.

Signed-off-by: Ties de Kock <ties@tiesdekock.nl>
  * Log a message when supplied configuration value is unknown, e.g. "ipv6"
    instead of "ip6"

    Example log message:
    ```
    level=info msg="Unknown IP protocol selected (valid values: 'ip4'/'ip6'), using default of 'ip6'"
    ```

  * Default to ipv6 for unknown values instead of falling back to ip4.

Signed-off-by: Ties de Kock <ties@tiesdekock.nl>
@ties ties force-pushed the feature/chooseprotocol-invalid-ipprotocol-handling branch from 6c8048b to e09a777 Compare April 12, 2023 11:46
@github-actions github-actions bot added the stale label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant