summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2020-03-31 07:04:11 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2020-03-31 07:04:11 +0900
commit1f0834814a49d82d6f6bb91577f0b10179275964 (patch)
tree9598a7b94d90be7085365bdb86a5539bd8ff4864
parentec9cb7a1e44fe286d9d21f400761944e8c4ac0e7 (diff)
packet: fix typos
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
-rw-r--r--pkg/packet/mrt/mrt.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/packet/mrt/mrt.go b/pkg/packet/mrt/mrt.go
index 70788325..f2005c72 100644
--- a/pkg/packet/mrt/mrt.go
+++ b/pkg/packet/mrt/mrt.go
@@ -199,11 +199,11 @@ type Peer struct {
AS uint32
}
-var errNotAllPeerBytesAbailable = errors.New("not all Peer bytes are available")
+var errNotAllPeerBytesAvailable = errors.New("not all Peer bytes are available")
func (p *Peer) DecodeFromBytes(data []byte) ([]byte, error) {
if len(data) < 5 {
- return nil, errNotAllPeerBytesAbailable
+ return nil, errNotAllPeerBytesAvailable
}
p.Type = uint8(data[0])
p.BgpId = net.IP(data[1:5])
@@ -211,13 +211,13 @@ func (p *Peer) DecodeFromBytes(data []byte) ([]byte, error) {
if p.Type&1 > 0 {
if len(data) < 16 {
- return nil, errNotAllPeerBytesAbailable
+ return nil, errNotAllPeerBytesAvailable
}
p.IpAddress = net.IP(data[:16])
data = data[16:]
} else {
if len(data) < 4 {
- return nil, errNotAllPeerBytesAbailable
+ return nil, errNotAllPeerBytesAvailable
}
p.IpAddress = net.IP(data[:4])
data = data[4:]
@@ -225,13 +225,13 @@ func (p *Peer) DecodeFromBytes(data []byte) ([]byte, error) {
if p.Type&(1<<1) > 0 {
if len(data) < 4 {
- return nil, errNotAllPeerBytesAbailable
+ return nil, errNotAllPeerBytesAvailable
}
p.AS = binary.BigEndian.Uint32(data[:4])
data = data[4:]
} else {
if len(data) < 2 {
- return nil, errNotAllPeerBytesAbailable
+ return nil, errNotAllPeerBytesAvailable
}
p.AS = uint32(binary.BigEndian.Uint16(data[:2]))
data = data[2:]