554 Commits
Author SHA1 Message Date
FUJITA Tomonori 30ec3477ce server: fix non StartServer API crash
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 <[email protected]>
2016-05-11 22:43:32 +09:00
FUJITA Tomonori 292a61b9cc server: print correct reason of state change by configuration change
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 <[email protected]>
2016-05-11 16:19:57 +09:00
ISHIDA Wataru 4ce4ae0b62 server: stop sending notification message twice
fix 3ced192e5c

we've already sent one before arriving here

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-11 06:17:14 +00:00
FUJITA Tomonori 9c94fd72f7 server: pretty notification error code log
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-10 14:14:16 +09:00
FUJITA Tomonori 18738e1b43 server: log the change of admin state via config file
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-10 12:42:51 +09:00
FUJITA Tomonori 808331b0f4 docs: add comment for dubious code
[ci skip]

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-10 05:57:39 +09:00
FUJITA Tomonori 515e2a5188 server: log notification error code
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-10 05:07:17 +09:00
FUJITA Tomonori 64ff0fec11 grpc: remove MRT dump streaming GRPC API
Seems that nobody is interested in receiving MRT dump over streaming
GRPC API. Let's remove it.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-10 15:16:02 +09:00
FUJITA Tomonori f9a9c410c3 Refactoring GRPC API
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 <[email protected]>
2016-05-10 14:10:43 +09:00
ISHIDA Wataru d7e1add28a server: don't modify admin-down config
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-10 02:20:07 +00:00
FUJITA Tomonori bcb6c38b47 server: immediately close newly accepted connection for non admin-state-up peer
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-09 12:01:35 +09:00
ISHIDA Wataru 5d7c1a00df server: support afi-safi re-configuration
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 <[email protected]>
2016-05-09 08:40:04 +00:00
ISHIDA Wataru eda648181f server: support timer re-configuration
timer re-configuration won't kill BGP session.
new values will be used for next BGP session establishment.

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-09 08:24:19 +00:00
ISHIDA Wataru 3ced192e5c server: fix to send more appropriate notification code/subcode
admin-down : 6/2
peer-as/neighbor-address : 6/3
other : 6/6

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-09 07:43:43 +00:00
ISHIDA Wataru 978c6a3df0 server: ignore stale fsm messages
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-09 04:50:10 +00:00
ISHIDA Wataru f7540b7715 server: don't block select loop by Sleep(), use Timer instead
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-09 04:48:28 +00:00
FUJITA Tomonori 8685ce669b server: don't apply in policy to EOR path
EOR path doesn't have theh complete information so applying a policy
to EOR path leads to crash.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-06 14:12:21 +09:00
FUJITA Tomonori 58bff63736 fix 3327661896 regression
We can't send a path to a peer if the peer isn't configured for its
family.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-05 23:29:00 +09:00
ISHIDA Wataru 6e8d1bb162 config: support reload of AdminDown
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-27 10:32:42 +00:00
ISHIDA Wataru ec0d19acd5 server: support peer re-configuration
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-27 10:32:42 +00:00
ISHIDA Wataru 43f3d009d6 server: fix not to modify Transport.Config
modify Transport.State instead

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-27 10:32:42 +00:00
ISHIDA Wataru f99362e876 config: make listen config struct aligned with open-config model
have config/state container

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-27 10:32:39 +00:00
ISHIDA Wataru f6c70e980d config: make route-target config struct aligned with open-config model
have config/state container

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-27 10:07:02 +00:00
FUJITA Tomonori 21938add9f move NeighborPortNumber config to transport.Config
More appropriate.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-26 07:20:47 +09:00
FUJITA Tomonori 45050d9b97 remove collector mode support
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 <[email protected]>
2016-04-25 23:52:21 +09:00
ISHIDA Wataru 6f95b7dc62 server: issue SOFT_RESET_IN when policy assignment is changed
fix 0c58e348de

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-25 03:16:18 +00:00
ISHIDA Wataru 205063dc83 server: remove updatedPeerCh and policyUpdateCh
handle them in handleGrpc()

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-24 18:44:37 +00:00
FUJITA Tomonori 0c58e348de server: sending SOFT_RESET_IN on all the peer after the policy changes with config file
Apply the new policies (in and import) to the existing routes.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-22 16:10:02 +09:00
ISHIDA Wataru a34d8d2651 config: simplify config structures
stop generating self-contained leafref fields in openconfig model.
(e.g. bgp:neighbor/bgp:neighbor-address )

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-21 08:57:21 +00:00
ISHIDA WataruandFUJITA Tomonori c6ddfb1d8e table: use received time as tie-breaker
older path get preference

can be disabled by
`global.route-selection-options.external-compare-router-id = true`

close #806

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-21 15:37:11 +09:00
ISHIDA WataruandFUJITA Tomonori 8ab34acd76 fsm: improve fsm state transition log
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-21 15:35:07 +09:00
FUJITA Tomonori 7d5a97862f rpki: validate only when RPKI is enabled
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-21 13:32:40 +09:00
FUJITA Tomonori 92012ee629 table: Destination's Calculate doesn't need to return newly added paths
Nobody uses them.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-21 13:32:37 +09:00
FUJITA Tomonori fb83e41aeb rpki: use the own AS number if asPath is empty
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-21 13:32:34 +09:00
FUJITA Tomonori 35efcd570d rpki: delete roa validation stream API
better to be implemented outside GoBGP.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-21 13:29:59 +09:00
ISHIDA Wataru 733b05b831 policy: don't allow same policy assigned twice
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-20 09:17:22 +00:00
ISHIDA Wataru e21e48410a server: fix bug of policy assignment
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-20 09:17:20 +00:00
ISHIDA WataruandFUJITA Tomonori 802879087d server: support route-target constraint
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-20 13:14:09 +09:00
ISHIDA WataruandFUJITA Tomonori d62e65f4fe fsm: improve debug message
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-20 13:14:09 +09:00
ISHIDA Wataru d632d9cdf2 server: support prefix-limit re-configuration via configuration file
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru 56b69b7679 peer: remove redundant config structs
preparation for #597
stop messing up where neighbor configuration is stored
just keep it in each peers' fsm struct

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru cb19260575 server: fix bug of BgpServer.PeerDelete()
`GrpcRequest.Data` is supposed to be `*Peer` not `Peer`

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru efc61d809c server: fix Peer.prefixLimitWarned to adapt with multi-protocol
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru daaa9302ba config/gobgpd: refactoring
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru 642270bb32 cli: show prefix-limit configuration by gobgp neighbor <neighbor-addr>
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 06:23:42 +00:00
ISHIDA Wataru 00039df827 fsm: improve log message when prefix-limit reached
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 06:21:59 +00:00
Shawn SmithandFUJITA Tomonori 3bd6e20fe4 server: fix comment typo 2016-04-19 10:52:44 +09:00
ISHIDA WataruandFUJITA Tomonori 3327661896 server: send local withdrawal paths regardless of path calculation result
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 09:56:41 +09:00
FUJITA Tomonori 9c3e5b159c packet: create bmp package
move bmp stuff from bgp to bmp package.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-12 09:39:09 +09:00
FUJITA Tomonori 8daa511657 packet: create rtr package
move rtr stuff from bgp to rtr package.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-12 09:12:30 +09:00