-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ospf6d: memcmp cleanup #10070
ospf6d: memcmp cleanup #10070
Conversation
As part of the check, it memcompares two structs ospf6_path. This struct has a pointer field nh_list which is allocated every time a new path is created, which means it can never be the same for two different paths. Therefore this check is always false and can be completely removed. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDTest incomplete. See below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: IncompleteAddresssanitizer topotests part 4: Incomplete(check logs for details)Topotests Ubuntu 18.04 amd64 part 4: Failed (click for details)Topotests Ubuntu 18.04 amd64 part 4: No useful log foundSuccessful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 i386 part 4: Failed (click for details)Topotests Ubuntu 18.04 i386 part 4: No useful log foundSuccessful on other platforms/tests
|
@@ -704,27 +704,6 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route, | |||
} | |||
|
|||
if (old) { | |||
/* if route does not actually change, return unchanged */ | |||
if (ospf6_route_is_identical(old, route)) { |
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.
Rather than entirely remove this, shouldn't it now become a simple pointer comparison? If the comparison is always false for different struct instances as you say then we should still check if the instance is the same right?
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.
Yeah, I thought about this, but it's not possible either. route
is always a new object (lock is asserted to be 0), and old
is always an existing object (lock is decremented).
@frrbot rereview |
Style please |
Using memcmp with complex structures like prefix or ospf6_ls_origin is not correct, because even two structures with same values in all fields may have different values in padding bytes and comparison will fail. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
01d4fb7
to
66314e9
Compare
Force-pushed to fix style warnings. |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 i386 part 4: Failed (click for details)Topotests Ubuntu 18.04 i386 part 4: No useful log foundTopotests debian 10 amd64 part 4: Failed (click for details)Topotests debian 10 amd64 part 4: No useful log foundSuccessful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDTest incomplete. See below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: IncompleteAddresssanitizer topotests part 4: Incomplete(check logs for details)Successful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 amd64 part 4: Failed (click for details)Topotests Ubuntu 18.04 amd64 part 4: No useful log foundSuccessful on other platforms/tests
|
ci:rerun |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-1602/ This is a comment from an automated CI system. |
@frrbot rereview |
Check individual commits.