summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-09 13:21:41 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-09 13:21:41 +0900
commit900cb321fb3dc353b102aa1970e652184abc24eb (patch)
tree2fa7ba4dd183781051b10c1df52043e433da0ca3 /packet/bgp.go
parent0ad83ce995ab8c87c2f68aa4d52a22e1a232ab1d (diff)
table: fix tableKey()
tableKey() must use Prefix (address + mask) as key. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r--packet/bgp.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index 505212b4..ae222a34 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -469,6 +469,10 @@ func (r *IPAddrPrefixDefault) Len() int {
return int(1 + ((r.Length + 7) / 8))
}
+func (r *IPAddrPrefixDefault) String() string {
+ return fmt.Sprintf("%s/%d", r.Prefix.String(), r.Length)
+}
+
type IPAddrPrefix struct {
IPAddrPrefixDefault
addrlen uint8