mirror of
https://github.com/vishvananda/netlink
synced 2024-12-26 16:42:22 +00:00
Filter RouteListFiltered response by requested IP family in
This commit is contained in:
parent
0e685ffcfc
commit
aafe841692
@ -1148,6 +1148,10 @@ func (h *Handle) RouteListFiltered(family int, filter *Route, filterMask uint64)
|
||||
var res []Route
|
||||
for _, m := range msgs {
|
||||
msg := nl.DeserializeRtMsg(m)
|
||||
if msg.Family != uint8(family) {
|
||||
// Ignore routes not matching requested family
|
||||
continue
|
||||
}
|
||||
if msg.Flags&unix.RTM_F_CLONED != 0 {
|
||||
// Ignore cloned routes
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user