-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DHCPv6 Relay] [202106] Fix kernel memory allocation, log verbosity and dhcpmon bugs #8975
Merged
kellyyeh
merged 4 commits into
sonic-net:202106
from
shlomibitton:shlomi_dhcp6_relay_fixes
Oct 19, 2021
Merged
[DHCPv6 Relay] [202106] Fix kernel memory allocation, log verbosity and dhcpmon bugs #8975
kellyyeh
merged 4 commits into
sonic-net:202106
from
shlomibitton:shlomi_dhcp6_relay_fixes
Oct 19, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…cate memory' issue Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
Change the verbosity level from ERROR to INFO for returned code of 'Network is unreachable' when sending packets. This is because by design, the relay will try to relay packets to all DHCP servers even if there is no route to it and then the error message will print out. Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
…MGMT interface. The MGMT is incremented to check if DHCP packets are traveling through mgmt interface, it is not part of the aggregate device counters. To allow checking the MGMT interface health as well, we need to check the counters of MGMT interface also, so on function 'dhcp_device_check_health' we need to check the current device counters, not only the aggregate device. Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
Get the correct option ID in order to get the inner DHCP message Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
shlomibitton
changed the title
[DHCPv6 Relay] [202106] Fix kernel memory allocation issue and log verbosity for unreachable network
[DHCPv6 Relay] [202106] Fix kernel memory allocation, log verbosity and dhcpmon bugs
Oct 17, 2021
@tahmed-dev can you please review? |
@tahmed-dev could you please help to review? |
@kellyyeh can you please review as I do not have access anymore? |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
kellyyeh
approved these changes
Oct 18, 2021
This was referenced Oct 19, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did it
This PR fix 2 issues for DHCPv6 relay.
Kernel socket memory allocation size is too small for 'setsockopt', causing an exception and crashing the DHCPv6 daemon:
setsockopt: IPV6_JOIN_GROUP: Cannot allocate memory
To fix it, the memory size for sockets has been enlarged to 40960.
By design, the DHCPv6 relay will start while considering all L3 interfaces as up link interfaces.
When a DHCPv6 packet get to the CPU the relay will try to transmit it to all up link interfaces.
This can lead to ERROR messages in the log: "ERR dhcp_relay#dhcrelay[40]: send_packet6: Network is unreachable" as there is no route to the DHCP server from all up link interfaces.
Thus, changing the verbosity is required for not to alert unnecessary ERROR messages in syslog.
Fix 'dhcpmon', exclude incrementing the aggregate device if packets received on the MGMT interface.
The MGMT is incremented to check if DHCP packets are traveling through MGMT interface, it is not part of the aggregate device counters.
To allow checking the MGMT interface health as well, we need to check the counters of MGMT interface also, so in function 'dhcp_device_check_health' we need to check the current device counters, not only the aggregate device.
Fix 'dhcpmon' DHCP header offset calculation.
Get the correct option ID in order to get the inner DHCP message.
How I did it
How to verify it
Configure DHCPv6 relay.
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)