summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
AgeCommit message (Collapse)Author
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-01Fix some typos found by spell checkerIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-07server: fix "occurred" spellingVincent Bernat
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-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-07-18server: Set outgoing TTL before dialingIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-07-04support addpath recvISHIDA Wataru
2017-06-23server: Enable to configure static TTL for BGP packetsIWASE Yusuke
Like "ttl" configuration of Junos OS, this patch enables to set static TTL value for outgoing BGP packets. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-23server: Implement TTL securityIWASE Yusuke
This patch enable to configure Generalized TTL Security Mechanism (GTSM). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-16config: Use State to get NeighborAddress instead of ConfigSatoshi Fujimoto
By introducing dynamic neighbor feature, GoBGP can have dynamic neighbors, and corresponding Config.NeighboAddress can be empty. This patch sets State.NeighborAddress for all neighbors, and gets the neighbor's address from them. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-06-09bmp: Support number of withdraw updates and prefixesIWASE Yusuke
This patch enables to send BMP statistics reports for the following types; - Stat Type = 11: (32-bit Counter) Number of updates subjected to treat-as-withdraw treatment. - Stat Type = 12: (32-bit Counter) Number of prefixes subjected to treat-as-withdraw treatment. Note: Currently, this implementation considers only updates or prefixes received from neighbors, but not enough to follow the handling process described in RFC7606. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-07replace github.com/Sirupsen/logrus with github.com/sirupsen/logrusFUJITA Tomonori
The usage of "github.com/sirupsen/logrus" is recommended. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-06server: Close conn when graceful restart timer expiredWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-05-09server: ignore routes when local AS is in AS_PATHISHIDA Wataru
RFC4271 9.1.2 Phase 2: Route Selection If the AS_PATH attribute of a BGP route contains an AS loop, the BGP route should be excluded from the Phase 2 decision function. AS loop detection is done by scanning the full AS path (as specified in the AS_PATH attribute), and checking that the autonomous system number of the local system does not appear in the AS path. Operations of a BGP speaker that is configured to accept routes with its own autonomous system number in the AS path are outside the scope of this document. Also this commit adds support for allow-own-as option to relax this. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04skip asn negotiation for BGP unnumbered peersISHIDA Wataru
since BGP unnumbered peers are typically trusted, skip asn negotiation for easy configuration. from configuration file: ```toml [[neighbors]] [[neighbors.config]] neighbor-interface = "eth0" ``` from cli: ``` $ gobgp neighbor add interface eth0 ``` Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04packet/bgp: add extended-nexthop capabilityISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-02-03cli: Administrative Shutdown Communication on disable neighborIWASE Yusuke
This patch adds "--reason" option support into the disable neighbor command which can specify "Administrative Shutdown Communication" on the BGP Cease NOTIFICATION message. Usage: $ gobgp neighbor <neighbor address> disable --reason "some messages" Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-02-03server/fsm: Logging Administrative Shutdown CommunicationIWASE Yusuke
This patch enable to log the body of the Cease NOTIFICATION message with "Administrative Shutdown" and "Administrative Reset" subcodes. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2016-10-13server: fix error propagationWataru Ishida
creating new `err` variable prevents proper error propagation which leads to wrongly contine reading BGP messages even after receiving an invalid update message. Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-10-09*: support long lived graceful restartWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-10-09*: Notification support for BGP GRWataru Ishida
implement draft-ietf-idr-bgp-gr-notification-07 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-03move policyMutex to policy/FUJITA Tomonori
It's more logical. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-30all logging is done with log.WithFieldsdsp
Signed-off-by: dsp <dsp@2f30.org> Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-06-16Fix a typo in FSM stateThomas Morin
s/notificatoin/notification/
2016-06-27fix two-bytes AS translationFUJITA Tomonori
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 6f644ee1ca1be81e6ec96c8504e34c26b3d1f8a8 Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> 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 <fujita.tomonori@lab.ntt.co.jp>
2016-06-28fsm: do two-bytes AS translation if didn't sent 4byte capFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-26support AGGREGATOR and AS4_AGGREGATOR conversionFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-14server: replace SenderMsg workaround with InfiniteChannelFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01server/config: fix md5ed ipv6 active connectionISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2016-05-20server: fix connectLoop() select loop not to blockISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2016-05-20server: fix connectLoop() goroutine leakISHIDA Wataru
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 <ishida.wataru@lab.ntt.co.jp>
2016-05-20server: stringify FSM state in log messagesISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-11server: print correct reason of state change by configuration changeFUJITA Tomonori
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 <fujita.tomonori@lab.ntt.co.jp>
2016-05-11server: stop sending notification message twiceISHIDA Wataru
fix 3ced192e5c5bda81290e4a13d17bedd66b36b439 we've already sent one before arriving here Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-10server: pretty notification error code logFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10server: log notification error codeFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-10server: don't modify admin-down configISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: fix to send more appropriate notification code/subcodeISHIDA Wataru
admin-down : 6/2 peer-as/neighbor-address : 6/3 other : 6/6 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: ignore stale fsm messagesISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-09server: don't block select loop by Sleep(), use Timer insteadISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-06server: don't apply in policy to EOR pathFUJITA Tomonori
EOR path doesn't have theh complete information so applying a policy to EOR path leads to crash. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-27config: support reload of AdminDownISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-26move NeighborPortNumber config to transport.ConfigFUJITA Tomonori
More appropriate. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-21config: simplify config structuresISHIDA Wataru
stop generating self-contained leafref fields in openconfig model. (e.g. bgp:neighbor/bgp:neighbor-address ) Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-21fsm: improve fsm state transition logISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-20fsm: improve debug messageISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19peer: remove redundant config structsISHIDA Wataru
preparation for #597 stop messing up where neighbor configuration is stored just keep it in each peers' fsm struct Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19fsm: improve log message when prefix-limit reachedISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19server: fix comment typoShawn Smith