[bgpd] Add 'bgp open-accept' option, to send OPEN immediately on accepted conns

2007-08-31 Paul Jakma <paul.jakma@sun.com>

	* (general) Add 'bgp open-accept' option, to allow bgpd to send OPEN
	  on accepted connections, i.e. to not wait till after
	  collision-detect to send OPEN, which appears to be allowed in
	  RFC4271. This may help speed up establishing sessions, or help
	  avoid FSM problems with sessions to certain peers. Not enabled by
	  default though.
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 15bd8a6..df1cfb7 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -616,7 +616,8 @@
 	zlog_debug ("%s passive open", peer->host);
     }
 
-  if (! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+  if (!CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)
+      || bgp_option_check (BGP_OPT_ALWAYS_OPEN))
     bgp_open_send (peer);
 
   return 0;