summaryrefslogtreecommitdiffhomepage
path: root/server
AgeCommit message (Collapse)Author
2018-04-09server: Avoid infinite UPDATE loop of RTM NLRIIWASE Yusuke
When GoBGP dropped adj-Rib-out per Peer, we fixed to send the same Route Target Membership (RTM) NLRI even if it is already sent. This can cause the infinite UPDATE loop when Route Reflector(RR) reflects RTM NLRI to its clients. For example, the following situation causes the infinite UPDATE loop. Topology: +----- RR -----+ | | Client1 Client2 When Client1 has VRF with RT 65000:1 and sends a RTM NLRI to RR, then RR reflects the NLRI to Client2. If a new VRF with the same RT 65000:1 on Client2 is created, Client2 will notify it to RR, then RR calculates the best, but RR will send the NLRI from Client2 to Client1 even if it is not the best. Client1 receives the NLRI again, calculates the best and re-sends the best. Then, RR reflects the received NLRI ... (infinite loop). This patch fixes to compare the candidate path to be sent with the old path and assume the given candidate path was already sent before if the candidate path and the old path is the same path. Then avoids the infinite UPDATE loop. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-05server/rpki: fixed ROA sortAbhijit Gadgil
The typo in function Less() was causing logical error during comparison and the comparison would always return whether AS number was less or not regardless of Maxlen. fixes #1633
2018-04-03packet/bgp: Getter functions for AS segmentIWASE Yusuke
This patch adds getter functions for the segment type and AS list of each segment without using type assertion. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-03-27server/server: Set rsRib to RS client in adding dynamic neighborSatoshi Fujimoto
Currently, globalRib is always set to dynamic neighbors even if they are route server clients. This patch fixes to set rsRib when the neighbor is a route server client. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-03-22Fix AddPath MarshallingOption bug.kishiguro
When neighbor had AddPath capability, then disable AddPath after that. Old marshallingOptions remains. So once neighbor enabled AddPath it can't be disabled with no AddPath capability option in Open Message.
2018-02-23zclient: Avoid directly access to RIBIWASE Yusuke
In order to avoid races, zclient should not access to RIB without calling APIs of BgpServer. But currently zclient directly accesses to the global RIB when handling NEXTHO_UPDATE messages. This patch fixes this problem by calling BgpServer.GetRib(). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-08config: Option to disable best path selectionIWASE Yusuke
Note: When this option is specified, no path will be redistributed to any peer, because there is no best path. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-01server: fix dynamic neighbor crashFUJITA Tomonori
close #1575 if L854 is executed before L924, we hit a crash because of closing a channel twice. This fixes the isseu but We had better to refactor the code to delete a peer. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-26server: Avoid to delete received paths with DeletePath APIIWASE Yusuke
"cli-command-syntax.md" describes "rib del all" command should delete all locally generated paths, but currently this command deletes all paths including received path from neighbors unexpectedly. This patch fixes the DeletePath API to delete only locally generated paths and solves this problem. Current: $ gobgp global rib -a ipv4 Network Next Hop AS_PATH Age Attrs *> 10.12.1.0/24 0.0.0.0 00:00:00 [{Origin: ?}] * 10.12.1.0/24 10.0.0.1 65001 00:00:00 [{Origin: ?}] $ gobgp global rib -a ipv4 del all $ gobgp global rib -a ipv4 Network not in table With this patch: $ gobgp global rib -a ipv4 Network Next Hop AS_PATH Age Attrs *> 10.12.1.0/24 0.0.0.0 00:00:00 [{Origin: ?}] * 10.12.1.0/24 10.0.0.1 65001 00:00:00 [{Origin: ?}] $ gobgp global rib -a ipv4 del all $ gobgp global rib -a ipv4 Network Next Hop AS_PATH Age Attrs *> 10.12.1.0/24 10.0.0.1 65001 00:00:10 [{Origin: ?}] Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-01-26server: resolve next-hop with FRR/Zebra for VRF routesAman Shaikh
2018-01-24*: Use strconv.ParseUint instead of strconv.Atoi()IWASE Yusuke
For the 32-bit platform compatibility. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-01-11server_test: Enhance test cases for MonitorRib APIIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-01-11server: Empty path list in initial WatchEventUpdateIWASE Yusuke
Currently, MonitorRib API with ADJ_IN type and "current" flag returns the initial response with an empty path list when gRPC client connecting to GoBGP daemon. This causes the client can not receive the current paths which GoBGP daemon already has. This patch fixes to compose the initial MonitorRib response with the current paths. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-12-16config/util: Refactor to make arguments to receiversSatoshi Fujimoto
For code readability, this commit make some arguments to receivers. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-12-07bmp: set A flag in Per-Peer HeaderFUJITA Tomonori
Needs to set set A flag in Per-Peer Header if the peer use the legacy 2-byte AS_PATH format. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-26cmd: fix getNeighbor() to take bogus neighbor nameFUJITA Tomonori
This fixes the ae7e572550df919c1b9990da8787fc1e860bc20d 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 <fujita.tomonori@lab.ntt.co.jp>
2017-11-23table: fix merging of v4 paths with addpath enabledFUJITA Tomonori
V4 NLRI needs more 4 bytes with addpath enabled. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-22server: Allow 0 value to roaManager.AS for library usageEiichiro Watanabe
2017-11-22server: adminDown operation wrongly resets State.PeerAsFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-21server: Auto derived ES-Import RT for EVPN Ethernet Segment routeIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-11-08config: Properly set config of PeerGroup memberSatoshi Fujimoto
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 <satoshi.fujimoto7@gmail.com>
2017-11-07*: Support BGP Confederations (RFC 5065)Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-07packet/bgp: Add Validation for BGP ConfederationsSatoshi Fujimoto
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 <satoshi.fujimoto7@gmail.com>
2017-11-07config: Pass Global Config to SetDefaultNeighborConfigSatoshi Fujimoto
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 <satoshi.fujimoto7@gmail.com>
2017-11-07server: Avoid local paths left on iBGP peersIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-11-02zclient: Register all nexthops contained in RIBsIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-11-02zclient: Unregister uninterested nexthopsIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-11-02server: function notifyPrePolicyUpdateWatcherIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-11-02zclient: Enable to connect to FRRoutingIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-01Fix some typos found by spell checkerIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-01Fix some spelling for spell checker's testIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-31server: fix AddPath to return uuid properlyFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-07server: fix "occurred" spellingVincent Bernat
2017-10-05server: stop Shutdown() with no peerFUJITA Tomonori
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 <fujita.tomonori@lab.ntt.co.jp>
2017-10-05server: Avoid applying policy multiply when updating pathIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-10-03mrt: Enable to dump MRT with Path IdentifierIWASE Yusuke
This patch enables to dump updates and table in MRT format with Path Identifier. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-03server: Add config.Neighbor into WatchEventUpdateIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-10-03server/mrt: Fix unfilled logging fieldIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-03server/mrt: Rename a variable to avoid name collisionIWASE Yusuke
The variable "m" in mrtWriter.loop() collides its receiver "m *mrtWriter". This patch renames this variable name. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-03server/mrt: Enable mrtWriter to access MrtConfigIWASE Yusuke
This patch enables mrtWriter to directly access config.MrtConfig values in case that some new options will be introduced. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-03config: add-paths structure per AFI-SAFIIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-09-30server: Remove the wrong and verbose return value in validatePath()Eiichiro Watanabe
2017-09-29server: Revised Error Handling (RFC7606)Satoshi Fujimoto
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 <satoshi.fujimoto7@gmail.com>
2017-09-14config: Introduce Family field into AfiSafiStateIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-09-06zclient: Code inspectionIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-09-06zebra/zapi: Define type for Zebra API message flagsIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-08-28server: export addROA()/delROA() for library usageEiichiro Watanabe
2017-08-13server: fix fd leak in DialTCP() on LinuxFUJITA Tomonori
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 <fujita.tomonori@lab.ntt.co.jp>
2017-08-02server: add sockopt ttl support to darwinFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-01server: fix zclient to handle route messages without nexthopFUJITA Tomonori
Seems that zebra could send a route message without nexthop (makes sense for withdraw). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>