827 Commits
Author SHA1 Message Date
FUJITA Tomonori 9225bec8e0 cmd: fix getNeighbor() to take bogus neighbor name
This fixes the ae7e572550 commit
regression. gobgp neighbor command takes a bogus neighbor name like
the following:

fujita@ubuntu:~/go/src/github.com/osrg/gobgp/gobgp$ ./gobgp n 1
BGP neighbor is 172.17.0.2, remote AS 65001
  BGP version 4, remote router ID unknown
  BGP state = active, up for 17496d 14:21:50
  BGP OutQ = 0, Flops = 0
  Hold time is 0, keepalive interval is 0 seconds
  Configured hold time is 60, keepalive interval is 20 seconds

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-11-26 23:16:25 +09:00
FUJITA Tomonori ab756c8937 table: fix merging of v4 paths with addpath enabled
V4 NLRI needs more 4 bytes with addpath enabled.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-11-23 21:43:50 +09:00
Eiichiro WatanabeandFUJITA Tomonori 667ffe3995 server: Allow 0 value to roaManager.AS for library usage 2017-11-22 16:22:35 +09:00
FUJITA Tomonori cf94bda929 server: adminDown operation wrongly resets State.PeerAs
Signed-off-by: FUJITA Tomonori <[email protected]>
2017-11-22 11:08:14 +09:00
IWASE YusukeandFUJITA Tomonori 511535e130 server: Auto derived ES-Import RT for EVPN Ethernet Segment route
According to RFC7432, the ES-Import RT can be derived automatically
when using the ESI Types 1, 2 and 3.

This patch enables to derive automatically the ES-Import RT for the
given path from BgpServer's API.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-21 10:56:23 +09:00
Satoshi Fujimoto ab95321191 config: Properly set config of PeerGroup member
Currently, the config of PeerGroup members are not set properly.

For example, if LocalAs of the neighbor is not set in the config file,
LocalAs will be set to Global.As as a default value.
After this, however, if the neighbor is a member of a peer group,
LocalAs will be unexpectedly overwritten by the peer group config.

This commit fixes this by setting default values after
applying the peer group config.

Adding to this, this commit avoids unnecessary applying
the peer group config.

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-11-08 10:14:21 +09:00
Satoshi FujimotoandFUJITA Tomonori 9e584acea9 *: Support BGP Confederations (RFC 5065)
Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-11-07 21:53:46 +09:00
Satoshi FujimotoandFUJITA Tomonori 9d90d038a7 packet/bgp: Add Validation for BGP Confederations
RFC 5065 says that:
"It is a error for a BGP speaker to receive an update message from a
confederation peer that is not in the same Member-AS that does not
have AS_CONFED_SEQUENCE as the first segment."

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-11-07 21:53:46 +09:00
Satoshi FujimotoandFUJITA Tomonori e541ede1b5 config: Pass Global Config to SetDefaultNeighborConfig
In neighbor config, there are some parameters whose
default value can be changed depending on the global config.

This commit modifies the argument of config.SetDefaultNeighborConfigValues()
to pass the global config. It enables to change the default
settings of neighbor depending on the global config.

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-11-07 21:53:46 +09:00
IWASE Yusuke a5715a7bc3 server: Avoid local paths left on iBGP peers
Currently, with iBGP peering, the CLI injected path will not be withdrawn
when the deletion if any other path exists on RIB, then the CLI injected
path will be left on iBGP peers even if the route is deleted on the
originator router.
This problem can cause routing loops in some case.

This patch fixes to withdraw the old best path when it was the CLI (or
gRPC) injected path.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-07 09:55:25 +09:00
IWASE Yusuke d3a2b6b2bb zclient: Register all nexthops contained in RIBs
Currently, zclient registers only nexthops which bound for the best
path, this patch enables to register all nexthops which contained in
RIBs in order to detect nexthops down faster.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-02 13:49:09 +09:00
IWASE Yusuke 6a99a086ae zclient: Unregister uninterested nexthops
This patch enables to unregister nexthop when received NEXTHOP_UPDATE
message and there is no path bound for the updated nexthop.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-02 13:49:09 +09:00
IWASE Yusuke 3a0c52c808 server: function notifyPrePolicyUpdateWatcher
The function for notifying WATCH_EVENT_TYPE_PRE_UPDATE event hasn't been
defined yet, this patch defines a function for it.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-02 13:49:09 +09:00
IWASE YusukeandFUJITA Tomonori d2a34c964a zclient: Enable to connect to FRRouting
Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-02 00:14:09 +09:00
IWASE YusukeandFUJITA Tomonori d8a897a0dd Fix some typos found by spell checker
Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-01 21:56:21 +09:00
IWASE YusukeandFUJITA Tomonori fbc493411b Fix some spelling for spell checker's test
Signed-off-by: IWASE Yusuke <[email protected]>
2017-11-01 21:56:21 +09:00
FUJITA Tomonori 8a22b48beb server: fix AddPath to return uuid properly
Signed-off-by: FUJITA Tomonori <[email protected]>
2017-10-31 23:34:34 +09:00
Vincent Bernat 7dcbffefc0 server: fix "occurred" spelling 2017-10-07 08:54:13 +02:00
FUJITA Tomonori cd85e47be2 server: stop Shutdown() with no peer
After Shutdown() is called, the main goroutine waits for peers'
goroutines to stop then dies. But if no peer is configured, the main
goroutines never dies.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-10-05 14:36:36 +09:00
IWASE YusukeandFUJITA Tomonori 6416a6dafb server: Avoid applying policy multiply when updating path
Currently, UpdatePath() of BgpServer will apply policy multiply, and
this causes the unexpected result of policy configurations.

This patch avoids this multiple policy application.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-10-05 11:09:31 +09:00
IWASE YusukeandFUJITA Tomonori 52a47a5fdc mrt: Enable to dump MRT with Path Identifier
This patch enables to dump updates and table in MRT format with Path
Identifier.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-10-03 23:04:20 +09:00
IWASE YusukeandFUJITA Tomonori e559d6f3dd server: Add config.Neighbor into WatchEventUpdate
This patch adds a field of config.Neighbor into WatchEventUpdate in
order to get config/state info of the neighbor which sent the UPDATE
message.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-10-03 23:04:20 +09:00
IWASE YusukeandFUJITA Tomonori 17c3694fca server/mrt: Fix unfilled logging field
Signed-off-by: IWASE Yusuke <[email protected]>
2017-10-03 23:04:20 +09:00
IWASE YusukeandFUJITA Tomonori bfc6d1b2f9 server/mrt: Rename a variable to avoid name collision
The variable "m" in mrtWriter.loop() collides its receiver "m *mrtWriter".
This patch renames this variable name.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-10-03 23:04:20 +09:00
IWASE YusukeandFUJITA Tomonori 2e214c9618 server/mrt: Enable mrtWriter to access MrtConfig
This patch enables mrtWriter to directly access config.MrtConfig values
in case that some new options will be introduced.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-10-03 23:04:20 +09:00
IWASE YusukeandFUJITA Tomonori 6ed2c5624c config: add-paths structure per AFI-SAFI
This patch introduce "add-paths" structure per AFI-SAFI in order to
enable to store add-paths feature config/state per AFI-SAFI.

Also, this patch renames a few variables to avoid the name collisions.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-10-03 14:53:44 +09:00
Eiichiro Watanabe 043d0d9530 server: Remove the wrong and verbose return value in validatePath() 2017-09-30 16:16:34 +09:00
Satoshi FujimotoandFUJITA Tomonori f70827b68c server: Revised Error Handling (RFC7606)
This patch enables GoBGP to keep the session established
even if the received BGPUpdate message contains some errors,
and to handle these errors according to what defined in RFC7606.

This feature is enabled when 'treat-as-withdraw' in
'neighbors.error-handling.config' is specified to true
in the GoBGP config file.

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-09-29 15:05:43 +09:00
IWASE Yusukeandfujita bb7d2f2541 config: Introduce Family field into AfiSafiState
To reduce the translations of "AfiSafiName" into "bgp.RouteFamily", this
patch introduces "Family" field into "AfiSafiState" and stores the
translated value.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-09-14 09:22:04 +09:00
IWASE YusukeandFUJITA Tomonori b0cd149707 zclient: Code inspection
Signed-off-by: IWASE Yusuke <[email protected]>
2017-09-06 08:14:14 +09:00
IWASE YusukeandFUJITA Tomonori 06d3e1585e zebra/zapi: Define type for Zebra API message flags
Signed-off-by: IWASE Yusuke <[email protected]>
2017-09-06 08:14:14 +09:00
Eiichiro Watanabe 2d65055028 server: export addROA()/delROA() for library usage 2017-08-28 14:58:27 +09:00
FUJITA Tomonori f615fa49a7 server: fix fd leak in DialTCP() on Linux
A new socket was created so we must close it before this function
returns _either_ on failure or success. On success, net.FileConn() in
newTCPConn() increases the refcount of the socket so this fi.Close()
doesn't destroy the socket; the caller can use it (and needs to close
it later).

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-08-13 00:22:10 +09:00
FUJITA Tomonori 26513c438e server: add sockopt ttl support to darwin
Signed-off-by: FUJITA Tomonori <[email protected]>
2017-08-02 10:22:09 +09:00
FUJITA Tomonori 15f598ad8e server: fix zclient to handle route messages without nexthop
Seems that zebra could send a route message without nexthop (makes
sense for withdraw).

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-08-01 09:24:14 +09:00
FUJITA Tomonori 122f08c1c5 server: fix active connection error check
https://github.com/osrg/gobgp/issues/1391

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-07-30 14:44:16 +09:00
FUJITA Tomonori 0730e0f9dd add addpath send support
Signed-off-by: FUJITA Tomonori <[email protected]>
2017-07-26 08:09:02 +09:00
FUJITA Tomonori c99e499bce server: remove unnecessary Filter() in rs
RS peers and non RS peers uses different tables so no need to filter
paths from rs clients for non rs clients.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-07-26 08:09:02 +09:00
Satoshi Fujimoto 2678142d30 rpki: Collect detailed information while validating
Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-07-19 09:44:20 +09:00
IWASE Yusuke c3d98dac4d server: Set incoming TTL before accepting connection
Signed-off-by: IWASE Yusuke <[email protected]>
2017-07-18 15:11:05 +09:00
IWASE Yusuke 178e65f8f1 server: Set outgoing TTL before dialing
Signed-off-by: IWASE Yusuke <[email protected]>
2017-07-18 15:11:01 +09:00
IWASE Yusuke eb95f000bf server: Skip TCP MD5Sig sockopt when empty auth-password
Signed-off-by: IWASE Yusuke <[email protected]>
2017-07-14 13:16:48 +09:00
ISHIDA WataruandFUJITA Tomonori 454fd93ef7 support addpath recv 2017-07-04 14:24:57 +09:00
FUJITA Tomonori 04ce5ce295 use Destination instead of Path for path selection API
With Destination struct, multiple Paths can be moved from the table
package to the server package in a cleaner way; for features such as
add-path.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-07-04 09:30:48 +09:00
FUJITA Tomonori 547cd0893a server: split rib into two
currently, route server peers and non route server peers use the
single global rib. To support deterministic-med for non route server
peers, this splits the rib into two; easier to handle the best path
selection in different ways.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-07-04 09:30:48 +09:00
IWASE YusukeandFUJITA Tomonori bb562572bc server: Enable to configure static TTL for BGP packets
Like "ttl" configuration of Junos OS, this patch enables to set static
TTL value for outgoing BGP packets.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-06-23 18:13:19 +09:00
IWASE YusukeandFUJITA Tomonori 4af2f4b7d5 server: Implement TTL security
This patch enable to configure Generalized TTL Security Mechanism
(GTSM).

Signed-off-by: IWASE Yusuke <[email protected]>
2017-06-23 18:13:19 +09:00
IWASE YusukeandFUJITA Tomonori 613d8a1e93 server/sockopt: Support to set minimum TTL
Signed-off-by: IWASE Yusuke <[email protected]>
2017-06-23 18:13:19 +09:00
Satoshi Fujimoto 85a62d8ede peer: Set NeighborAddress before initializing dynamic peers
If State.NeighborAddress is not set, setting default configs
for the dynamic peers will fail. This patch set State.NeighborAddress
before setting default configs.
And this patch avoids overwriting State.NeighborAddress if it is set.

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-20 11:28:09 +09:00
Satoshi Fujimoto 1c7829604d peer: Check errors in creating Dynamic Peers
Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-20 11:24:05 +09:00