summaryrefslogtreecommitdiffhomepage
path: root/pkg/packet
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-16 10:09:41 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-11-16 10:09:41 +0900
commit893dbd5c074c097f0c9921d3131a072011fb7e6a (patch)
treef3391c602f3b715f16e600b8cbee6d33208ee3bc /pkg/packet
parent62076da8d430889d29276314465bdad9fa1b7e2c (diff)
packet: fix ValidateAttribute() to handle ipv6 addresss
fixes #1893 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/packet')
-rw-r--r--pkg/packet/bgp/validate.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/packet/bgp/validate.go b/pkg/packet/bgp/validate.go
index 60cf26e4..a76c906a 100644
--- a/pkg/packet/bgp/validate.go
+++ b/pkg/packet/bgp/validate.go
@@ -159,6 +159,10 @@ func ValidateAttribute(a PathAttributeInterface, rfs map[RouteFamily]BGPAddPathM
}
isClassDorE := func(ip net.IP) bool {
+ if ip.To4() == nil {
+ // needs to verify ipv6 too?
+ return false
+ }
res := ip[0] & 0xe0
return res == 0xe0
}