From 062357469b3f82679faebd870d05f2c13ddd8241 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Mon, 3 Aug 2015 16:09:31 +0900 Subject: packet: fix RouteDistinguisherFourOctetAS.String() Signed-off-by: ISHIDA Wataru --- packet/bgp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packet/bgp.go') diff --git a/packet/bgp.go b/packet/bgp.go index 450d0864..d058d1ec 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -826,7 +826,9 @@ func (rd *RouteDistinguisherFourOctetAS) Serialize() ([]byte, error) { } func (rd *RouteDistinguisherFourOctetAS) String() string { - return fmt.Sprintf("%d:%d", rd.Admin, rd.Assigned) + fst := rd.Admin >> 16 & 0xffff + snd := rd.Admin & 0xffff + return fmt.Sprintf("%d.%d:%d", fst, snd, rd.Assigned) } func NewRouteDistinguisherFourOctetAS(admin uint32, assigned uint16) *RouteDistinguisherFourOctetAS { -- cgit v1.2.3