summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2018-04-10goreleaser: add arm64 binaryFUJITA Tomonori
fixes #1640 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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-04-03packet/bgp: Return nil for invalid redirect IP addressIWASE Yusuke
When initializing IPv4AddressSpecificExtended or IPv6AddressSpecificExtended structure, nil value will be returned when an invalid IP address is given. But the redirect action extended community types; - RedirectIPv4AddressSpecificExtended - RedirectIPv6AddressSpecificExtended which embed IP address specific extended community types, are not aware of nil value when initializing, so these redirect action extended community can be unexpectedly initialized with nil value. This patch fixes to check return value of the embedded structure and also return nil when failure of initializing it. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03packet/bgp: Initializer func for PMSI Tunnel ID typesIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03packet/bgp: Avoid data races when serializingIWASE Yusuke
Because "Serialize()" functions of NLRIs or PathAttributes can be called from some different goroutines, updating fields of a structure can cause data races. This patch moves the normalization for each field (mostly length and flags calculation) into "NewXxx()" or "DecodeFromBytes()" and avoids the data races. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03packet/bgp: Initializer func for EVPN NLRIsIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03packet/bgp: Remove length argument from NewEVPNNLRIIWASE Yusuke
The length value can be retrieved from the route type specific data field and need not to be specified at the initialization. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03packet/bgp: Missing funcs to calc byte length of NLRIIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03packet/bgp: Remove binary field of RouteDistinguisherIWASE Yusuke
Keeping binary representation increases the size of structure and can cause data races. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03bgp_race_test: Unit test to detect data racesIWASE Yusuke
This patch adds UT file to detect data races when serializing BGP UPDATE messages. Example of Usage: $ go test -race github.com/osrg/gobgp/packet/bgp -run ^Test_RaceCondition$ Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-02README: Update list of docsIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-02*.md: Improvements for markdownlintIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-02travis: Introduce markdownlintIWASE Yusuke
When using IDE (e.g. VSCode), we can easily check the results of markdownlint and it should not be a heavy burden to write docs. This patch introduces an unit test to invoke markdownlint on Travis-CI. See https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md, for configuration details of ".markdownlint.json". Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-01GoBGP 1.30FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-28cmd/*: Pass number of expected args to extractReserved()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-03-28cmd/common: Specify number of expected argumentsSatoshi Fujimoto
In CLI operation, currently, unexpected argument names (such as 'aspath' for 'gobgp neighbor add') may pass the validations and return no errors. This commit prevents accepting those argument names by specifying the number of expected arguments for each argument names. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@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-03-20cmd/global: Refine parameter description in Help messageSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-03-20cmd/global: Add help messages for L3VPN and MPLSSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-03-19packet/bgp: make serialization of ipv4/v6 nlri goroutine-safeFUJITA Tomonori
The serialization of ipv4/v6 nlri should be goroutine-safe but somehow not. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-03-02GoBGP 1.29FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-25docs: update gettting-startedFUJITA Tomonori
The way to install GoBGP is outdated. README tells how so let's remove. Also bash completion scripts haven't be updated for long time so let's remove too. [ci skip] Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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-22packet/bgp: Return specified type value for UnknownExtendedIWASE Yusuke
Currently, "UnknownExtended.GetTypes()" returns always the constant values even if "Type" value is given. This patch fixes to return the given type value and use the first "Value" byte as the sub type. Also, introduces "NewUnknownExtended()" function for the convenience. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-22packet/bgp: Flatten structure of OpaqueExtendedIWASE Yusuke
Currently, to instantiate sub types of the Opaque Extended Community, it is required to instantiate "OpaqueExtended" and its value type (e.g., "ValidationExtended" or "EncapExtended") and also specify its sub type. This can cause the confusion of the outer and inner (value) structures and the unmatch of the value structure and its sub type. This patch makes the "OpaqueExtended" into more flat structure and introduces "NewXxxExtended()" function to improve usability. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-22packet/bgp: Fix a typo of TunnelType stringIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-21table: fix handleMacMobility()FUJITA Tomonori
needs to find a diffrent ESI with the same mac address. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-21packet/bgp: Rename AigpTLV to AigpTLVInterfaceIWASE Yusuke
The other interface types in "packet/bgp" package have "Interface" suffix. This patch fixes to follow this naming convention. Golang's naming convention recommends to use "er" suffix though. Also, this patch moves the AIGP TLVs definitions to the near of the PathAttributeAigp structure and defines NewAigpTLVDefault function. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-19packet/bgp: Fix a typo of TunnelEncapSubTLVUnknownIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-18add golang 1.10 supportFUJITA Tomonori
drop 1.8 support also. Note that ugly double quates are necessary https://github.com/travis-ci/gimme/issues/132 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-16config/default: Default value of route-reflector-cluster-idIWASE Yusuke
Currently "0.0.0.0" is the default of "route-reflector-cluster-id" and this patch fixes to use "router-id" as its default value. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-16table/path: Originator ID for locally generated pathsIWASE Yusuke
The current implementation unexpectedly sets "0.0.0.0" as the ORIGINATOR_ID value for the locally generated paths when acting as a Route Reflector. This patch fixes to set own Router ID as the ORIGINATOR_ID value. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-16cli: Support to advertise PMSI Tunnel AttributeIWASE Yusuke
This patch enables "gobgp" command to advertise the PMSI Tunnel Attribute which is appended to the EVPN Inclusive Multicast Ethernet Tag routes for example. Usage Example: $ gobgp global rib -a evpn add multicast 10.0.0.1 etag 10 rd 65000:100 pmsi ingress-repl 100 1.1.1.1 $ gobgp global rib -a evpn Network Labels Next Hop AS_PATH Age Attrs *> [type:multicast][rd:65000:100][etag:10][ip:10.0.0.1] 0.0.0.0 00:00:00 [{Origin: ?} {Pmsi: type: ingress-repl, label: 100, tunnel-id: 1.1.1.1}] Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-16cli: Display error reason for "rib add/del" commandsIWASE Yusuke
Currently, the error reason for "rib add/del" commands are displayed only when the "*-flowspec" families. This patch fixes to display the error reason for other families and helps to detect which arguments are invalid. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-16packet/bgp: Fix bitSize of ESI typeIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-13packet/bgp: Refactor TunnelEncapSubTLV structureIWASE Yusuke
This patch refactors the structure of TunnelEncapSubTLV sub-types to have the similar structure of PathAttribute sub-types, and makes easy to implement MarshalJSON() functions for TunnelEncapSubTLV sub-types. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-13packet/bgp: Missing String()/MarshalJSON() of PathAttribute subsIWASE Yusuke
First this patch removes String() and MarshalJSON() functions of PathAttribute struct. This helps to find the struct types which embed PathAttribute struct without having own String() and MarshalJSON() functions. If those functions of PathAttribute struct are unexpectedly called, those functions are not enough to display its contents. Then this patch implements missing String() and MarshalJSON() functions for some struct types which embed PathAttribute struct. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-13packet/bgp: Remove raw binary field on PathAttributeIWASE Yusuke
The current implementation, PathAttribute stores the raw binary data as "Value" field, but this field increases the memory consumption. This patch removes "Value" field to slim down. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-10flow_spec_test: Enhance test cases with ExaBGPIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-10test/lib/exabgp: Enable to get adj-RIB-{in,out}IWASE Yusuke
"exabgpcli" supports to show adj-RIB-in and adj-RIB-out, this patch enables ExaBGPContainer to get these RIBs information. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-10test/lib/exabgp: Use exabgpcli to add/del routesIWASE Yusuke
Currently, to advertise or withdraw routes with ExaBGPContainer, we need to configure static routes via config file and restart ExaBGP daemon. In other words, we can NOT send withdrawing advertisement with ExaBGPContainer. Also, restating ExaBGP daemon frequently can make scenario test unstable, and it should be avoided. On the other hand, with ExaBGP version 4.0.5 or later(*), we can advertise or withdraw routes using "exabgpcli" without restating ExaBGP daemon (or writing application which calls ExaBGP's APIs). This patch fixes to use "exabgpcli" and reduces the number of restating ExaBGP daemon. Note: According to this change, adding routes into ExaBGP should be called after adding neighbor. (*): "exabgpcli" is introduced at version 4.0.2, but has some bugs related to Python 3 compatibility and FlowSpec rules combinations, then we need to use version 4.0.5 or later. 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-06table: Change type of BestPathReason to uint8IWASE Yusuke
The current type is string, which size is multiple of byte(=uint8). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-06table: replace time.Time struct with int64 in originInfo structFUJITA Tomonori
We don't need nanosecond precision. shrinks from 96 to 80 bytes. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-06table: change originInfo struct layout to reduce the sizeFUJITA Tomonori
shrinks from 112 to 96 bytes. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-02GoBGP 1.28FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>