mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-11 09:21:49 +01:00
20 lines
607 B
Go
20 lines
607 B
Go
|
//go:build: freebsd
|
||
|
package systemops
|
||
|
|
||
|
import "syscall"
|
||
|
|
||
|
// filterRoutesByFlags - return true if need to ignore such route message because it consists specific flags.
|
||
|
func filterRoutesByFlags(routeMessageFlags int) bool {
|
||
|
if routeMessageFlags&syscall.RTF_UP == 0 {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// NOTE: syscall.RTF_WASCLONED deprecated in FreeBSD 8.0 (https://www.freebsd.org/releases/8.0R/relnotes-detailed/)
|
||
|
// a concept of cloned route (a route generated by an entry with RTF_CLONING flag) is deprecated.
|
||
|
if routeMessageFlags&(syscall.RTF_REJECT|syscall.RTF_BLACKHOLE) != 0 {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
return false
|
||
|
}
|