summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
AgeCommit message (Collapse)Author
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
2016-04-11Add neighbor-port-number to bgp neighbor configYi Tseng
Allow user to setup neighbor BGP TCP port (Default is 179)
2016-04-10server: support prefix-limitISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-10server: serialize in fsm send loopISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-10fsm: delegate 2byte as handling to fsm send goroutineISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-03-31move packet/*.go to packet/bgp/*.go for Go's conventionFUJITA Tomonori
Later, we move non-bgp protocol stuff like mrt under their own direcotries. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-15Revert "fsm: remove redundant connection close"FUJITA Tomonori
when hold timer expires, established() goroutine exits so even if tx() goroutine writes to errorCh, nobody closes the connection. The, rx() goroutine doesn't finish, so gobgpd hits panic(). This reverts commit 38bd31856b5eff046a4874e83b53cb7d3e45cdaf. Conflicts: server/fsm.go
2016-03-12fsm: support active connection with md5 and bindingISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-03-07server: make rx goroutine reading from socket never sleepFUJITA Tomonori
Currently, the rx goroutine reading from socket (recvMessageloop funciton) sleeps if msgCh is full. The problem is that if the rx goroutine stops reading from a socket, keepalives are ignored, the holdtime on gobgp expires even if a peer properly sends keepalives. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-07server: clean up recvMessageWithErrorFUJITA Tomonori
better way to avoid blocked on channel. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-07server: recvMessageWithError avoid blocked due to msgChFUJITA Tomonori
Preparation for make recvMessageWithError() avoid being blocked. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-07server: make sure recvMessageWithError() not blocked due to errorChFUJITA Tomonori
probably doesn't happen but be cautious. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-02fsm: fix min keepalive interval to 1sec from 1nsISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-02-29config/server: support per-peer asnISHIDA Wataru
you can override `global.config.as` by `neighbor.config.local-as` Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-02-29server: support active connection with md5 protectionISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>