summaryrefslogtreecommitdiffhomepage
path: root/server/watcher.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-13 12:42:30 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-11-13 12:42:30 +0900
commit12ae1b784d400103623aca5554382e84d9843a28 (patch)
tree7ee602f7f40cc00cb3b8c9c04a77d4bd9499ffd5 /server/watcher.go
parent515abe28802b7062f3af080c0bd0187e2aa62280 (diff)
mrt: use on-wire original update data for mrt
bgpd parse on-wire original update data to construct BGPMessage object and serialize it. Sometimes the both data is not idential. For example, the original data sets the extended length for attribute even if the length is less than 256. This commit fixes the above issue. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/watcher.go')
-rw-r--r--server/watcher.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/watcher.go b/server/watcher.go
index 73c3f251..d186e9cf 100644
--- a/server/watcher.go
+++ b/server/watcher.go
@@ -64,6 +64,7 @@ type watcherEventUpdateMsg struct {
localAddress net.IP
fourBytesAs bool
timestamp time.Time
+ payload []byte
}
type watcher interface {
@@ -115,7 +116,8 @@ func (w *mrtWatcher) loop() error {
write := func(ev watcherEvent) {
m := ev.(*watcherEventUpdateMsg)
subtype := bgp.MESSAGE_AS4
- mp := bgp.NewBGP4MPMessage(m.peerAS, m.localAS, 0, m.peerAddress.String(), m.localAddress.String(), m.fourBytesAs, m.message)
+ mp := bgp.NewBGP4MPMessage(m.peerAS, m.localAS, 0, m.peerAddress.String(), m.localAddress.String(), m.fourBytesAs, nil)
+ mp.BGPMessagePayload = m.payload
if m.fourBytesAs == false {
subtype = bgp.MESSAGE
}