-
Notifications
You must be signed in to change notification settings - Fork 543
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
Fix issue with setting IP address in run time. #241
Conversation
thanks for submitting this fix. i have once checked the ifconfig behavior and found this wired routine but didn't find a food solution of it. have you checked what's the time gap between the nlmsgs? because orchagent has retry logic while trying to apply tasks repeatedly, how many times of the |
orchagent/intfsorch.cpp
Outdated
continue; | ||
} | ||
|
||
bool overlaps = false; |
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 add some comments here to about the ifconfig
issue? it helps.
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.
sure
@stcheng time frame between netlink messages is quite small. During tests I saw from one to four messages about overlap. |
Issue: sonic-net/SONiC#22 Issue was observed only when setting IP address via ifconfig command. Caused by ifconfig command behavior: first is sets IP address with netmask /8 and then changes netmask to specified in command. Problem is not observed when set IP address with "ip addr" command.
Thanks. Could you also try to resolve the |
@oleksandrivantsiv, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
Issue: sonic-net/SONiC#22 Issue was observed only when setting IP address via ifconfig command. Caused by ifconfig command behavior: first it sets IP address with netmask /8 and then changes netmask to specified in command. Problem is not observed when set IP address with "ip addr" command. Introduced overlaps variable to check if the newly set IP prefix has any overhaps with the current IP prefixes and wait until there is no overlaps at all.
/* NOTE: Overlap checking is required to handle ifconfig weird behavior. | ||
* When set IP address using ifconfig command it applies it in two stages. | ||
* On stage one it sets IP address with netmask /8. On stage two it | ||
* changes netmask to specified in command. As DB is async event to |
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.
specified in command [](start = 34, length = 20)
Did you test ifconfig with a smaller netmask, such as /7 or /8?
…ommands if flag is passed (sonic-net#241)
* [pfcwd]: Add support to poll queue attr in syncd * update as comments * remove extra empty line
…me could be difficult to predict in unit tests (sonic-net#241)
Issue: sonic-net/SONiC#22
Issue was observed only when setting IP address via ifconfig
command. Caused by ifconfig command behavior: first is sets
IP address with netmask /8 and then changes netmask to specified
in command. Problem is not observed when set IP address with
"ip addr" command.