mirror of
https://github.com/vishvananda/netlink.git
synced 2025-09-27 12:12:09 +08:00
Filter RouteListFiltered response by requested IP family in
This commit is contained in:

committed by
Alessandro Boch

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
|
||||||
|
Reference in New Issue
Block a user