[dhcp6relay] Check interface address is not NULL#11359
Merged
jimmyzhai merged 2 commits intosonic-net:masterfrom Jul 8, 2022
Merged
[dhcp6relay] Check interface address is not NULL#11359jimmyzhai merged 2 commits intosonic-net:masterfrom
jimmyzhai merged 2 commits intosonic-net:masterfrom
Conversation
Pterosaur
reviewed
Jul 6, 2022
|
|
||
| ifa_tmp = ifa; | ||
| while (ifa_tmp) { | ||
| while (ifa_tmp && ifa_tmp->ifa_addr) { |
Contributor
There was a problem hiding this comment.
If the mdio interface(no address interface) is the first node of interface list, all other normal ports will also be skipped. Is this logic correct?
Contributor
Author
There was a problem hiding this comment.
You are right. Fix it by checking it in if condition.
yxieca
approved these changes
Jul 7, 2022
qiluo-msft
pushed a commit
that referenced
this pull request
Jul 8, 2022
Why I did it Daemon dhcp6relay may crash due to null pointer access to ifa_addr member of struct ifaddrs. It's not guaranteed that the interface must have available ifa_addr. That is true for some special virtual/pseudo interfaces. How I did it Check the pointer to ifa_addr is valid ahead of accessing it.
Contributor
|
@kellyyeh to cherry-pick this change into dhcp relay submodule and we will take from submodule. |
liushilongbuaa
pushed a commit
to liushilongbuaa/sonic-buildimage
that referenced
this pull request
Sep 23, 2022
Related work items: sonic-net#284, sonic-net#288, sonic-net#624, sonic-net#630, sonic-net#640, sonic-net#2164, sonic-net#2206, sonic-net#2207, sonic-net#2233, sonic-net#2234, sonic-net#2238, sonic-net#8857, sonic-net#10034, sonic-net#10519, sonic-net#10685, sonic-net#10711, sonic-net#10987, sonic-net#10990, sonic-net#11047, sonic-net#11070, sonic-net#11117, sonic-net#11186, sonic-net#11207, sonic-net#11213, sonic-net#11215, sonic-net#11220, sonic-net#11221, sonic-net#11257, sonic-net#11291, sonic-net#11298, sonic-net#11301, sonic-net#11326, sonic-net#11333, sonic-net#11335, sonic-net#11341, sonic-net#11344, sonic-net#11347, sonic-net#11359, sonic-net#11366, sonic-net#11368, sonic-net#11370, sonic-net#11372, sonic-net#11375, sonic-net#11385, sonic-net#11386, sonic-net#11394, sonic-net#11397, sonic-net#11401, sonic-net#11402, sonic-net#11403, sonic-net#11405, sonic-net#11414
richardyu-ms
pushed a commit
to richardyu-ms/sonic-buildimage
that referenced
this pull request
Nov 25, 2022
Related work items: sonic-net#90, sonic-net#282, sonic-net#7652, sonic-net#11220, sonic-net#11333, sonic-net#11358, sonic-net#11359, sonic-net#11371, sonic-net#11383, sonic-net#11386, sonic-net#11391, sonic-net#11398, sonic-net#11400, sonic-net#11406, sonic-net#11414, sonic-net#11421, sonic-net#11422, sonic-net#11427, sonic-net#11448, sonic-net#11451
This file contains hidden or 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
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
Daemon dhcp6relay may crash due to null pointer access to
ifa_addrmember ofstruct ifaddrs. It's not guaranteed that the interface must have availableifa_addr. That is true for some special virtual/pseudo interfaces.How I did it
Check the pointer to
ifa_addris valid ahead of accessing it.How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)