fix logic bug caused by operator precedence

This commit is contained in:
youngifif 2024-05-24 14:09:26 +08:00 committed by Alessandro Boch
parent 1e68b2710d
commit 4d4ba1473f

View File

@ -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 || filterMask&RT_FILTER_TABLE == 0 {
// Ignore non-main tables
continue
}