summaryrefslogtreecommitdiffhomepage
path: root/server
AgeCommit message (Collapse)Author
2016-05-20server: fix connectLoop() select loop not to blockISHIDA Wataru
connect() blocks MIN_CONNECT_RETRY-1 (= 9sec) at most. If a passive connection comes, establish BGP sessions, then BGP sesions goes down right after that (this can happen when the peer sent invalid update messages etc..) while connect() is blocking, FSM.StateChange(), which writes to fsm.getActiveCh can also block. This leads to block the main goroutine in server.go. This commit fix the issue by invoking a goroutine for connect() each time. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-20server: fix connectLoop() goroutine leakISHIDA Wataru
While Connect() is proceeding, fsm can be stopped administratively. In this case, after success of Connect(), no one is reading fsm.connCh, so connectLoop() goroutine can be leaked. This commit fix this issue. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-20server: make active md5ed socket nonblockingISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-20server: stringify FSM state in log messagesISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-19server: return flowspec routes in rfc compliant mannerISHIDA Wataru
The order of the flowspec routes matters because they will be used as ACL rules and what rule will be applied depends on the order. RFC5575 specifies how flowspec routes should be sorted. This commit implements what it says. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-18server: fix socket leak in DialTCPTimeoutWithMD5Sig()ISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-17server: fix wrong usage of zapiISHIDA Wataru
sending REDISTRIBUTE_DEFAULT_ADD command causes getting every routes zebra has which is not desirable behavior Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-17zebra: make zebra config consistent with the restsFUJITA Tomonori
- split config and state - move to Bgp structure (aligned with Rpki, Bmp, and Mrt) Also makes zebra configured via GRPC channel. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16server: fix a bug in handleGrpcGetPolicyAssignment()ISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-11server: fix non StartServer API crashFUJITA Tomonori
Any GRPC API request except for StartSever crashes gobgpd if it's called before StartServer API is called. This fixes the issue. panic: interface conversion: interface {} is nil, not *gobgpapi.GetNeighborResponse goroutine 21 [running]: github.com/osrg/gobgp/server.(*Server).GetNeighbor(0xc82012f520, 0x7f95f0a042b8, 0xc82016c4b0, 0x1138c40, 0xc82012f6f0, 0x0, 0x0) /home/fujita/go/src/github.com/osrg/gobgp/server/grpc_server.go:130 +0x238 github.com/osrg/gobgp/api._GobgpApi_GetNeighbor_Handler(0xcdb320, 0xc82012f520, 0x7f95f0a042b8, 0xc82016c4b0, 0xc820150c40, 0x0, 0x0, 0x0, 0x0, 0x0) /home/fujita/go/src/github.com/osrg/gobgp/api/gobgp.pb.go:3167 +0x16b google.golang.org/grpc.(*Server).processUnaryRPC(0xc820018bd0, 0x7f95f0a04078, 0xc820018c60, 0xc8200dc7e0, 0xc82012f540, 0x110c1b8, 0x0, 0x0, 0x0) /home/fujita/go/src/google.golang.org/grpc/server.go:522 +0xe30 google.golang.org/grpc.(*Server).handleStream(0xc820018bd0, 0x7f95f0a04078, 0xc820018c60, 0xc8200dc7e0, 0x0) Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-11server: print correct reason of state change by configuration changeFUJITA Tomonori
Changing some of configuration leads to sending a notification. So the reason of the BGP state change should be the notification. The main goroutine sends a notification, closes the connection, kill goroutines for the peer. So With the current code, the reason could be "rx failure", "tx failure", or "dying". To avoid that, this patch adds kinda workaround. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-11server: stop sending notification message twiceISHIDA Wataru
fix 3ced192e5c5bda81290e4a13d17bedd66b36b439 we've already sent one before arriving here Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-10server: pretty notification error code logFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10server: log the change of admin state via config fileFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10docs: add comment for dubious codeFUJITA Tomonori
[ci skip] Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10server: log notification error codeFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10grpc: remove MRT dump streaming GRPC APIFUJITA Tomonori
Seems that nobody is interested in receiving MRT dump over streaming GRPC API. Let's remove it. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10Refactoring GRPC APIFUJITA Tomonori
Let's follow the conventions of GRPC - Stop using one method for multiple operations like add, delete, etc. IOW, remove all the ModHoge APIs. - Stop abusing Streaming RPC API. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10server: don't modify admin-down configISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: immediately close newly accepted connection for non admin-state-up peerFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-09server: support afi-safi re-configurationISHIDA Wataru
Adding or deleting supported afi-safis will immediately reset BGP sesssion. Changing only prefix-limit configuration won't reset it. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: support timer re-configurationISHIDA Wataru
timer re-configuration won't kill BGP session. new values will be used for next BGP session establishment. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: fix to send more appropriate notification code/subcodeISHIDA Wataru
admin-down : 6/2 peer-as/neighbor-address : 6/3 other : 6/6 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: ignore stale fsm messagesISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: don't block select loop by Sleep(), use Timer insteadISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-06server: don't apply in policy to EOR pathFUJITA Tomonori
EOR path doesn't have theh complete information so applying a policy to EOR path leads to crash. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-05fix 332766189685028c4f9852e4285fb1a9025223cc regressionFUJITA Tomonori
We can't send a path to a peer if the peer isn't configured for its family. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-27config: support reload of AdminDownISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-27server: support peer re-configurationISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-27server: fix not to modify Transport.ConfigISHIDA Wataru
modify Transport.State instead Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-27config: make listen config struct aligned with open-config modelISHIDA Wataru
have config/state container Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-27config: make route-target config struct aligned with open-config modelISHIDA Wataru
have config/state container Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-26move NeighborPortNumber config to transport.ConfigFUJITA Tomonori
More appropriate. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-25remove collector mode supportFUJITA Tomonori
We need to update yang config collector mode (split into config and state). before that, let's remove the feature itself to see if there is any user of it. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-25server: issue SOFT_RESET_IN when policy assignment is changedISHIDA Wataru
fix 0c58e348de62bf156582417a6b9d726dd4fe116e Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-24server: remove updatedPeerCh and policyUpdateChISHIDA Wataru
handle them in handleGrpc() Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-22server: sending SOFT_RESET_IN on all the peer after the policy changes with ↵FUJITA Tomonori
config file Apply the new policies (in and import) to the existing routes. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-21config: simplify config structuresISHIDA Wataru
stop generating self-contained leafref fields in openconfig model. (e.g. bgp:neighbor/bgp:neighbor-address ) Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-21table: use received time as tie-breakerISHIDA Wataru
older path get preference can be disabled by `global.route-selection-options.external-compare-router-id = true` close #806 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-21fsm: improve fsm state transition logISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-21rpki: validate only when RPKI is enabledFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-21table: Destination's Calculate doesn't need to return newly added pathsFUJITA Tomonori
Nobody uses them. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-21rpki: use the own AS number if asPath is emptyFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-21rpki: delete roa validation stream APIFUJITA Tomonori
better to be implemented outside GoBGP. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-20policy: don't allow same policy assigned twiceISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-20server: fix bug of policy assignmentISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-20server: support route-target constraintISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-20fsm: improve debug messageISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19server: support prefix-limit re-configuration via configuration fileISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19peer: remove redundant config structsISHIDA Wataru
preparation for #597 stop messing up where neighbor configuration is stored just keep it in each peers' fsm struct Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>