Skip to content
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 logic bug caused by operator precedence #978

Merged

Conversation

youngifif
Copy link

No description provided.

route_linux.go Outdated
@@ -1157,7 +1157,7 @@ func (h *Handle) RouteListFiltered(family int, filter *Route, filterMask uint64)
continue
}
if msg.Table != unix.RT_TABLE_MAIN {
if filter == nil || filter != nil && filterMask&RT_FILTER_TABLE == 0 {
if filter == nil || (filter != nil && filterMask&RT_FILTER_TABLE == 0 ){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this to

if filter == nil || ]filterMask&RT_FILTER_TABLE == 0 {

A | (!A & B) is equivalent to A | B

@aboch
Copy link
Collaborator

aboch commented May 24, 2024

Please squash the two committee into one

@youngifif youngifif force-pushed the fix_logic_bug_caused_by_operator_precedence branch from c0016ab to 736bf39 Compare May 24, 2024 06:12
@youngifif youngifif force-pushed the fix_logic_bug_caused_by_operator_precedence branch from 736bf39 to bab65f1 Compare May 24, 2024 06:13
@youngifif
Copy link
Author

Please squash the two committee into one

👌

@aboch aboch merged commit 4d4ba14 into vishvananda:main May 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants