579 Commits
Author SHA1 Message Date
ISHIDA Wataru 3c377d437d server: fix another regression of active connection
Another regression introduced by 4c9cd88c61

Previous fix (81bc3851b2) fixes active
connection of neighbors configured via configuration file.
This fixes that of neighbors configured via gRPC API.

Test is also added.

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-02 15:48:31 +00:00
ISHIDA Wataru 81bc3851b2 server: fix active connection regression
regression introduced by 4c9cd88c61

also fix test/lib to test configuration without local-address
(configure local-address only if neighbor-address is IPv6)

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-01 17:37:58 +00:00
ISHIDA Wataru addc3902e8 server: support peering with ipv6 link local address
fix DialTCPTimeoutWithMD5Sig to handle ipv6 scope-id
also update ipv6 test to test this feature

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-01 05:06:37 +00:00
ISHIDA Wataru 4c9cd88c61 server/config: fix md5ed ipv6 active connection
Local address of md5ed active connection was hard-coded as "0.0.0.0".

Let's set appropriate default local address (0.0.0.0 or ::) in
SetDefaultConfigValues() and clean up (*FSM).connectLoop() instead of
ad-hoc connectLoop() fix.

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-01 05:06:37 +00:00
FUJITA Tomonori ec4e7a755f server: avoid sending unnecessary udate messages with soft_reset_in for route server
The current code sets a path to table.POLICY_DIRECTION_NONE, which is
still rib's knowPathList. Next time the best path selection happens,
the path is moved to oldKnownPathList and wrongly the best path
selection code could assume that it was the old best path, and sends
an unnecessary update message.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-31 17:55:08 +09:00
ISHIDA WataruandFUJITA Tomonori 70434c96d2 policy: add support setting self ip address as next-hop
from configuration file

[policy-definitions.statements.actions.bgp-actions]
set-next-hop = "self"

from cli

$ gobgp policy statement stmt1 add action next-hop self

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-26 23:19:04 +09:00
ISHIDA Wataru 0dbf1d87cb policy: add local-pref action
$ gobgp policy statement st01 add action local-pref 110

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-25 02:53:42 +00:00
FUJITA Tomonori 7c42e295e2 add collector feature
dump the update messages and the state change of peers into influxdb:

[collector.config]
  url = "http://localhost:8086"
  db-name = "gobgp"

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-23 20:32:47 +09:00
ISHIDA WataruandFUJITA Tomonori a7521827e1 server/table: fix intra-AS RTC route distribution
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA WataruandFUJITA Tomonori b09e276561 policy: apply export-policy after normal path-attribute updates
fix incomplete 42ab037635

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA WataruandFUJITA Tomonori c5fae01b02 vrf: fix rtc withdraw handling
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA WataruandFUJITA Tomonori a4c2ea3d18 server: improve log message
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA WataruandFUJITA Tomonori 5f25a1b6b3 server: add missing call of processOutgoingPaths()
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
FUJITA Tomonori 90c8306a9c server: handle grpc Serve() error
Serve() returns when accept() failed. After that, gobgp stop listening
on grpc port (no more grpc request).

This patch makes sure that gobgp starts listening on grpc port again.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-23 09:24:23 +09:00
ISHIDA WataruandFUJITA Tomonori 42ab037635 policy: apply export-policy after normal path-attribute updates
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-21 07:45:13 +09:00
ISHIDA WataruandFUJITA Tomonori c7e1f88da3 cli: include route-reflector/route-server infomation in Peer message
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-21 07:45:12 +09:00
ISHIDA Wataru d22476cb31 server: fix connectLoop() select loop not to block
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 <[email protected]>
2016-05-20 06:10:34 +00:00
ISHIDA Wataru c2a0e730ec server: fix connectLoop() goroutine leak
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 <[email protected]>
2016-05-20 05:47:11 +00:00
ISHIDA Wataru 2e2d67c967 server: make active md5ed socket nonblocking
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-20 05:47:09 +00:00
ISHIDA Wataru f811801f1c server: stringify FSM state in log messages
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-20 02:14:49 +00:00
ISHIDA Wataru b281f7f4ff server: return flowspec routes in rfc compliant manner
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 <[email protected]>
2016-05-19 00:44:47 +00:00
ISHIDA Wataru ac42568f3c server: fix socket leak in DialTCPTimeoutWithMD5Sig()
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-18 04:39:03 +00:00
ISHIDA Wataru c008e48b23 server: fix wrong usage of zapi
sending REDISTRIBUTE_DEFAULT_ADD command causes getting every routes
zebra has which is not desirable behavior

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-17 13:38:43 +00:00
FUJITA Tomonori 8fd25af4ce zebra: make zebra config consistent with the rests
- 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 <[email protected]>
2016-05-17 08:52:28 +09:00
ISHIDA WataruandFUJITA Tomonori e6b4e0f4ed server: fix a bug in handleGrpcGetPolicyAssignment()
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-16 16:31:01 +09:00
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