From c5b7496d0bd0ec98360044dfda21ab864df0b9cb Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 28 Jun 2016 12:26:47 +0900 Subject: fix support AGGREGATOR and AS4_AGGREGATOR conversion Fix the following commit: commit de58be441150daf8943a5a66ced6703b8201303e Author: FUJITA Tomonori Date: Sun Jun 26 23:18:23 2016 +0900 support AGGREGATOR and AS4_AGGREGATOR conversion Signed-off-by: FUJITA Tomonori --- table/message.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'table') diff --git a/table/message.go b/table/message.go index 68801e73..9a25d98c 100644 --- a/table/message.go +++ b/table/message.go @@ -202,15 +202,16 @@ func UpdatePathAttrs4ByteAs(msg *bgp.BGPUpdate) error { func UpdatePathAggregator2ByteAs(msg *bgp.BGPUpdate) { as := uint32(0) var addr string - for _, attr := range msg.PathAttributes { + for i, attr := range msg.PathAttributes { switch attr.(type) { case *bgp.PathAttributeAggregator: agg := attr.(*bgp.PathAttributeAggregator) - agg.Value.Askind = reflect.Uint16 + addr = agg.Value.Address.String() if agg.Value.AS > (1<<16)-1 { as = agg.Value.AS - addr = agg.Value.Address.String() - agg.Value.AS = bgp.AS_TRANS + msg.PathAttributes[i] = bgp.NewPathAttributeAggregator(uint16(bgp.AS_TRANS), addr) + } else { + msg.PathAttributes[i] = bgp.NewPathAttributeAggregator(uint16(agg.Value.AS), addr) } } } -- cgit v1.2.3