The result of this change is that whereas previously, any value was accepted for the GRE parameter, including garbage, now only a DECIMAL integer between 0 and 65535 is accepted.
optional - GRE Type in case if user wants to send the packet via GRE tunnel. GRE type could be anything; it could also be left as empty; by default, it is 0x8949 for Mellanox; and 0x88be for the rest of the chips.
@bingwang-ms What do you think the correct validation should be? Accept decimal, hexadecimal, both?
Description
In June 2021, I opened https://github.com/Azure/sonic-buildimage/issues/7990 [mirroring] Missing type validations in config mirror-session command. This was addressed by https://github.com/Azure/sonic-utilities/pull/1825 Validate input of config mirror_session add. In particular, that PR introduced
GRE_TYPE_RANGE = click.IntRange(min=0, max=65535)
The result of this change is that whereas previously, any value was accepted for the GRE parameter, including garbage, now only a DECIMAL integer between 0 and 65535 is accepted.
The command reference https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md#mirroring-config-commands doesn't define it explicitly, but the following text suggests that hex format should at least be allowed, if not preferred:
optional - GRE Type in case if user wants to send the packet via GRE tunnel. GRE type could be anything; it could also be left as empty; by default, it is 0x8949 for Mellanox; and 0x88be for the rest of the chips.
@bingwang-ms What do you think the correct validation should be? Accept decimal, hexadecimal, both?
Steps to reproduce the issue:
sudo config mirror_session erspan add ERSPAN 100.0.0.1 100.0.0.2 0 11 0x8949
Describe the results you received:
Usage: config mirror_session erspan add [OPTIONS]