mirror of
https://github.com/vishvananda/netlink
synced 2025-01-14 02:51:12 +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
|
var res []Route
|
||||||
for _, m := range msgs {
|
for _, m := range msgs {
|
||||||
msg := nl.DeserializeRtMsg(m)
|
msg := nl.DeserializeRtMsg(m)
|
||||||
|
if msg.Family != uint8(family) {
|
||||||
|
// Ignore routes not matching requested family
|
||||||
|
continue
|
||||||
|
}
|
||||||
if msg.Flags&unix.RTM_F_CLONED != 0 {
|
if msg.Flags&unix.RTM_F_CLONED != 0 {
|
||||||
// Ignore cloned routes
|
// Ignore cloned routes
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user