summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-10-13 05:58:40 +0000
committerWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-10-13 06:04:17 +0000
commitc8ad82704cf58a0f06406ceb785e2ba952081c6a (patch)
tree71ab9a6c2f172190f99cfea7d51da6c40256e419
parent2ad40c3f1ed1d77c353f974c2731dac8e40b442b (diff)
server: fix error propagation
creating new `err` variable prevents proper error propagation which leads to wrongly contine reading BGP messages even after receiving an invalid update message. Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--server/fsm.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/fsm.go b/server/fsm.go
index c8ae658b..c72f7f24 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -651,7 +651,7 @@ func (h *FSMHandler) recvMessageWithError() (*FsmMsg, error) {
case bgp.BGP_MSG_UPDATE:
body := m.Body.(*bgp.BGPUpdate)
confedCheck := !config.IsConfederationMember(h.fsm.gConf, h.fsm.pConf) && config.IsEBGPPeer(h.fsm.gConf, h.fsm.pConf)
- _, err := bgp.ValidateUpdateMsg(body, h.fsm.rfMap, confedCheck)
+ _, err = bgp.ValidateUpdateMsg(body, h.fsm.rfMap, confedCheck)
if err != nil {
log.WithFields(log.Fields{
"Topic": "Peer",
@@ -663,7 +663,7 @@ func (h *FSMHandler) recvMessageWithError() (*FsmMsg, error) {
} else {
// FIXME: we should use the original message for bmp/mrt
table.UpdatePathAttrs4ByteAs(body)
- err := table.UpdatePathAggregator4ByteAs(body)
+ err = table.UpdatePathAggregator4ByteAs(body)
if err == nil {
fmsg.PathList = table.ProcessMessage(m, h.fsm.peerInfo, fmsg.timestamp)
id := h.fsm.pConf.Config.NeighborAddress