summaryrefslogtreecommitdiffhomepage
path: root/packet
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-08-03 16:09:31 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-05 17:24:36 +0900
commit062357469b3f82679faebd870d05f2c13ddd8241 (patch)
tree322ddb41d80905c34edbbd0839ed93a754bf4027 /packet
parentbf54d911b23b35b4947dd31a93054855aa237d68 (diff)
packet: fix RouteDistinguisherFourOctetAS.String()
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'packet')
-rw-r--r--packet/bgp.go4
1 files changed, 3 insertions, 1 deletions
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 {