summaryrefslogtreecommitdiffhomepage
path: root/pkg/server
AgeCommit message (Collapse)Author
2021-10-18tests: Check if ValidateOpenMsg() works agains router-id validationDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-18bgp: Validate router-id against 0.0.0.0 and ASN-wideDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-18chore: fix linting ineffassign and redundant type from array, slice, or map ↵Imcom Jin
composite literal
2021-10-15tests: Check if we return an error and not crash if r.Peer is nilDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-15server: Do not crash the server if an empty request over gRPCDonatas Abraitis
goroutine 11 [running]: github.com/osrg/gobgp/pkg/server.newNeighborFromAPIStruct(0x0, 0xb5dd20, 0xc0000b3aa0, 0xc0002d4048) /home/donatas/projects/gobgp/pkg/server/grpc_server.go:643 +0x57 github.com/osrg/gobgp/pkg/server.(*BgpServer).AddPeer.func1(0x4a38c9, 0xb40bc0) /home/donatas/projects/gobgp/pkg/server/server.go:2940 +0x36 github.com/osrg/gobgp/pkg/server.(*BgpServer).handleMGMTOp(0xc0000f3680, 0xc0004e4348) /home/donatas/projects/gobgp/pkg/server/server.go:240 +0x47 github.com/osrg/gobgp/pkg/server.(*BgpServer).Serve(0xc0000f3680) /home/donatas/projects/gobgp/pkg/server/server.go:422 +0x735 created by main.main /home/donatas/projects/gobgp/cmd/gobgpd/main.go:153 +0x3cf To replicate: from __future__ import absolute_import from __future__ import print_function import grpc from google.protobuf.any_pb2 import Any import gobgp_pb2 import gobgp_pb2_grpc import attribute_pb2 _TIMEOUT_SECONDS = 1000 def run(): channel = grpc.insecure_channel('localhost:50051') stub = gobgp_pb2_grpc.GobgpApiStub(channel) peers = stub.AddPeer( gobgp_pb2.AddPeerRequest( ), _TIMEOUT_SECONDS, ) for peer in peers: print(peer) if __name__ == '__main__': run() Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-13Update the hold timer when a BGP Update message is receivedPeter Hill
According to RFC4271, The calculated value indicates the maximum number of seconds that may elapse between the receipt of successive KEEPALIVE and/or UPDATE messages from the sender. This change will reset the hold timer in the update FSM case. (note, I am super new with Go. I'm not quite sure how to craft a good test case for this.)
2021-08-08server: fix ListVrf api to handle Name memberFUJITA Tomonori
Currently, just ignored. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-06-30Handle ttl-security option correctlyDonatas Abraitis
It wasn't configurable at all. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-24Add FQDN capabilityDonatas Abraitis
It's not kinda RFC (draft), but it's implemented and used in various other open-source software like FRRouting, Bird, ExaBGP. It's very handy when dealing with lots of peers. Exampe between GoBGP and FRRouting: ``` % ./cmd/gobgp/gobgp neighbor 192.168.10.123 | grep -A4 fqdn: fqdn: advertised and received Local: name: donatas-pc, domain: Remote: name: exit1-debian-9, domain: ``` ``` % vtysh -c 'show bgp neighbors 192.168.10.17 json' | jq .'"192.168.10.17".neighborCapabilities.hostName' { "advHostName": "exit1-debian-9", "advDomainName": "n/a", "rcvHostName": "donatas-pc", "rcvDomainName": "n/a" } ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-10Fixed dead lock bug caused by hold-time expiryzhouzijiang
Signed-off-by: zhouzijiang <zhouzijiang@jd.com>
2021-04-22Do not suppress initial non-established peer state in MonitorPeerCarl Baldwin
The issue with the initial update was that sometimes a connection had not yet been established. Trying to get remote and local connection data caused a segmentation violation because `fsm.conn` was nil. Also adds a flag to MonitorPeerRequest in the GRPC API to enable the new behavior to avoid backward incompatibility. fixes #2047
2021-03-29Added ListDynamicNeighbor message to APIMarcus Wichelmann
2021-03-29Added DeleteDynamicNeighbor message to APIMarcus Wichelmann
2021-03-29Added ListPeerGroup message to APIMarcus Wichelmann
2021-03-16Add support for the gRPC server to listen on a unix domain socketbbassingthwaite
Fixes #2230
2021-03-03policy: add nexthop unchangedFaicker Mo
Support config set-next-hop = "unchanged" and also cli command. Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
2021-02-24server: fix AdministrativeCommunication message parserFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-02-13feat: add option to bind listener to a (VRF) deviceMilan Lenco
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2020-11-30Code changesSerguei Bezverkhi
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-11-29set shutdownWG to nil after stopBGP finishedDuan Jiong
otherwise gobgp will panic in handlefsmMsg when handle error condition Signed-off-by: Duan Jiong <duanjiong@yunify.com>
2020-11-09server: fix conversion from api.RouteAction to config.DefaultPolicyTypeFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2020-11-09server: handle bogus addpath argumentFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2020-11-06Adding gRPC support for modified logging levelSteve Shaw
Signed-off-by: Steve Shaw <shaw38@gmail.com>
2020-11-06Fix missing args in server testsAlistair King
2020-11-06Use MonitorTableRequest.Name to filter by peerAlistair King
Filter returned Paths based on provided peer address (similar to GetTable). This should improve performance when using MonitorTable with ADJ_IN and Current for a single peer.
2020-10-21api: add ListPathRequest's option to get binary of nlri and attributesFUJITA Tomonori
put the binary of nlri and path attribute to the response. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2020-10-21fix stuck routeJordan Whited
2020-10-20server: fix ListPolicyAssignment to handle empty policyFUJITA Tomonori
fix ListPolicyAssignment() return an assignment response even if the response doesn't have any policy. The assignment has default action policy so it's useful without any policy. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2020-09-16remove incomingCh when deleting dynamic peerChris Balmain
2020-07-04server: don't send empty ExtendedNexthop capabilityFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2020-05-13extend attributes proto for Prefix SID supportSerguei Bezverkhi
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
2020-04-26Refactoring Zebra and supporting frr7.3Hitoshi Irino
- Change const values to camel case from snake case to make zero golint's warnigns - Introduce convert functions (toEach, toCommon) between the newest version to older versions - Merge code about decode nexthop to reduce lines of code - Add frr7.3 statemet in allowable software for config - Rename and Update generated file by stringer
2020-03-11fixed style: unnecessary type cast after type switch and some minor issues.Sergey Elantsev
2020-02-19add support GetTable method for vrfs #2235Pavel Vorontsov
2020-01-05gobgpd: use map for validation tableToshiki Tsuchiya
`Table.destinations` is a map, so the order changes. This commit allows to get validate information from path by using map for validate table Fix: https://github.com/osrg/gobgp/issues/2223 Signed-off-by: Toshiki Tsuchiya <taruta0811@gmail.com>
2019-11-01bgp: fix dynamic neighbors with prefix "0.0.0.0/0"Faicker Mo
support prefix "0.0.0.0/0". Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
2019-10-26avoid installing routes with originator ID to global when softresetinFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-23Split Reset into three methodsCarl Baldwin
The Reset method was difficult to understand. The reason is that it was called in three different ways and did different things in each case. It is easier to read when the three different modes are each their own method. This came up as I was looking deeper into the threading model around policies. I think this change makes it easier to understand the code.
2019-10-22table: use net.IPNet for roa instead of homegrown IPPrefix structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-22move roa table code to table/ from server/FUJITA Tomonori
As the name implies, table/ is more appropriate for roa table code. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-21server: speed up session establishmentFUJITA Tomonori
The unittest on pkg/server finishes quicker. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-18Fix adj-out display with add path enabledmageshgv
2019-10-17Transition to graceful restart state on hold timer expiry if applicablemageshgv
2019-10-15Support vrfs in zapi multipathmageshgv
2019-10-11Remove policy from FSMCarl Baldwin
The `policy` member of fsm is apparently never used. Clean it up to avoid confusion. Policy is still set on the server and peers.
2019-10-04Maintain unique vrf IDs in watchEventBestPath vrf mapmageshgv
Fixes missing route propagation to proper vrfs in zapi
2019-10-02Update adjrib for LLGR and preserve aslooped attrMagesh GV
Fixes LLGR community cleared on softreset. Fixes AS Path looped routes added back to rib on Graceful Restart.
2019-10-01Fix crash on nonexistent vrf deleteMagesh GV
2019-09-17server: improve ListPath's performanceFUJITA Tomonori
send large data rather than sending small repeatedly. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-09-08execute rpki validation for policy only when it's necessaryFUJITA Tomonori
currently, validate is executed even if the result is not necessary. Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>