From 89b71e9bbf15c8f805d79c9f303c44b34eef2aa5 Mon Sep 17 00:00:00 2001 From: Liu Hua Date: Sat, 30 Jan 2016 15:34:36 +0000 Subject: [PATCH] force AddList to get rid of unexpected information Signed-off-by: Liu Hua --- addr_linux.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addr_linux.go b/addr_linux.go index 9373e9c..9e4f62f 100644 --- a/addr_linux.go +++ b/addr_linux.go @@ -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