diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-03 16:09:31 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-08-05 17:24:36 +0900 |
commit | 062357469b3f82679faebd870d05f2c13ddd8241 (patch) | |
tree | 322ddb41d80905c34edbbd0839ed93a754bf4027 /packet/bgp.go | |
parent | bf54d911b23b35b4947dd31a93054855aa237d68 (diff) |
packet: fix RouteDistinguisherFourOctetAS.String()
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r-- | packet/bgp.go | 4 |
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 { |