diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-13 15:06:37 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-14 22:46:05 +0900 |
commit | 07095596ae1072f5f4170f132106eef4854f5d93 (patch) | |
tree | 91e3a6170ff52834a3d9d4dc0c5cc1e1b81a3eda /gomrt | |
parent | 2709b94caaf51b3e376463491af33158a54c8369 (diff) |
mrt: kill homegrown maxuint16 definition
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'gomrt')
-rw-r--r-- | gomrt/packet/mrt.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gomrt/packet/mrt.go b/gomrt/packet/mrt.go index 29718403..62d4985f 100644 --- a/gomrt/packet/mrt.go +++ b/gomrt/packet/mrt.go @@ -20,12 +20,12 @@ import ( "encoding/binary" "fmt" "github.com/osrg/gobgp/packet" + "math" "net" ) const ( COMMON_HEADER_LEN = 12 - MaxUint16 = ^uint16(0) ) type Type uint16 @@ -214,8 +214,8 @@ func (p *Peer) Serialize() ([]byte, error) { if p.Type&(1<<1) > 0 { bbuf, err = packValues([]interface{}{p.AS}) } else { - if p.AS > uint32(MaxUint16) { - return nil, fmt.Errorf("AS number is beyond 2 octet. %d > %d", p.AS, MaxUint16) + if p.AS > uint32(math.MaxUint16) { + return nil, fmt.Errorf("AS number is beyond 2 octet. %d > %d", p.AS, math.MaxUint16) } bbuf, err = packValues([]interface{}{uint16(p.AS)}) } |