601 Commits
Author SHA1 Message Date
Thomas MorinandFUJITA Tomonori ffd482af28 Fix a typo in FSM state
s/notificatoin/notification/
2016-06-16 02:17:13 +09:00
Thomas MorinandFUJITA Tomonori 361dcc27da Do not crash on RTC wildcard routes
Do not crash and match everything when rt field
of a RouteTartgetMembershipNLRI is nil.

Bug-Url: #990
2016-06-16 02:17:12 +09:00
FUJITA Tomonori be0ebd60ff fix two-bytes AS translation
We can't use the two-bytes AS translation result by the previous
session. IOW, the peer might become 4bytes AS capable after the
session was down.

fix the regression of

commit 6f644ee1ca
Author: FUJITA Tomonori <[email protected]>
Date:   Tue Jun 28 10:44:07 2016 +0900

    fsm: do two-bytes AS translation if didn't sent 4byte cap

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-27 16:17:41 +09:00
FUJITA Tomonori 6f644ee1ca fsm: do two-bytes AS translation if didn't sent 4byte cap
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-28 10:44:07 +09:00
FUJITA Tomonori de58be4411 support AGGREGATOR and AS4_AGGREGATOR conversion
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-26 23:18:23 +09:00
FUJITA Tomonori d321b9a628 collector: doesn't write empty fields
Avoid writing empty fields with a withdraw message.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-27 12:36:29 +09:00
FUJITA Tomonori 0ef14bb14b collector: fix withdraw update crash
Withdraw message doesn't have ASPATH.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-27 12:35:54 +09:00
FUJITA Tomonori c9e86a9416 server: delete unused functions and variables
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-23 22:33:08 +09:00
FUJITA Tomonori eb032ff953 server: fix unit test
somehow travis-ci didn't catch

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-15 00:05:11 +09:00
FUJITA Tomonori 1f5a66a33c server: replace SenderMsg workaround with InfiniteChannel
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-14 16:49:34 +09:00
Antoine EicheandFUJITA Tomonori ca2e7730bd collector: Dump some path attributes and some ECs 2016-06-14 16:46:39 +09:00
FUJITA Tomonori 69b416145e server: fix aca6fd6ad4 regression
Fix the bug introduced by the following commit:

commit aca6fd6ad4
Author: ISHIDA Wataru <[email protected]>
Date:   Tue May 24 05:47:52 2016 +0000

server: refactoring for monitorbestchanged api. use watcher infra

The fix is a workaround. We need to rewrite monitor.go shortly to
remove the dependency of grpc from server package. So we fix this in a
cleaner way soon.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-14 10:40:17 +09:00
FUJITA Tomonori b8f83f8ede drop unknown optional non-transitive attributes
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-13 20:41:40 +09:00
Antoine EicheandFUJITA Tomonori 370f4ba1f0 collector: use AddrPrefixInterface.Flat to generate Prefix
The tag NLRI is also added to the update table.
2016-06-09 13:13:06 +09:00
ISHIDA Wataru d218ff032a server: remove restart() from watcher interface
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-10 01:47:10 +00:00
Antoine Eiche 50bf0d34d3 collector: ping InfluxDB and create database at startup
Ping InfluxDB to verify the connection at collector initialization and
create the database.
2016-06-07 19:09:50 +02:00
ISHIDA WataruandFUJITA Tomonori c96b6d1198 server: support monitoring multipath via gRPC
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-06 12:43:20 +09:00
ISHIDA WataruandFUJITA Tomonori c54f6e8289 server: support injecting multipath to zebra
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-06 12:43:20 +09:00
ISHIDA WataruandFUJITA Tomonori 5c7df67266 server/table: support bgp multipath
This patch adds multiPathList field to watcherEventBestPathMsg and
fills it when global.use-multiple-paths.config.enable = true

Following patches add support injecting multipath to zebra and
monitoring it via gRPC

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-06 12:43:20 +09:00
ISHIDA WataruandFUJITA Tomonori b63e1c1fc3 server: refactor monitor/watcher infra
have watcherManager to manage all watchers
also merge grpc neighbor state monitoring handling to grpcWatcher

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-06 12:43:20 +09:00
ISHIDA WataruandFUJITA Tomonori aca6fd6ad4 server: refactoring for monitorbestchanged api. use watcher infra
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-06 12:43:20 +09:00
ISHIDA WataruandFUJITA Tomonori 10746e5f4b server: refactoring for zebra related code use watcher infra
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-06 12:43:20 +09:00
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