mirror of
https://github.com/vishvananda/netlink.git
synced 2025-11-03 10:01:08 +08:00
force AddList to get rid of unexpected information
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
This commit is contained in:
@@ -101,6 +101,10 @@ func AddrList(link Link, family int) ([]Addr, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
if family != FAMILY_ALL && msg.Family != uint8(family) {
|
||||
continue
|
||||
}
|
||||
|
||||
attrs, err := nl.ParseRouteAttr(m[msg.Len():])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user