bgpd: Rollback "always send OPEN" a little, to workaround test suite issues
* "bgpd: Send OPEN immediately on inbound connections" doesn't play well with
some partial BGP implementations, test and conformance suites e.g., which
have rigid expectations about ordering and don't implement much of CD.
roll back, but only a little, by deferring OPEN sending on outbound till
receive.
* bgpd.h: (struct peer) add PEER_STATUS_OPEN_DEFERRED status flag.
Kind of a sub-fsm. Main FSM does not allow transition functions to
signal next-state - next-state is inflexibly fixed in the table -
so can't handle it cleanly at that level.
* bgp_fsm.c: (bgp_connect_success) Defer sending open if the peer is
an accept-peer/inbound and there appears to be an outbound connection
in progress. Set PEER_STATUS_OPEN_DEFERRED to signal to bgp_open_receive
that an OPEN still must be sent.
* bgp_packet.c: (bgp_open_receive) Send the OPEN here, when deferred.
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index c2df672..03df2f6 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -442,7 +442,7 @@
#define PEER_STATUS_ACCEPT_PEER (1 << 0) /* accept peer */
#define PEER_STATUS_PREFIX_OVERFLOW (1 << 1) /* prefix-overflow */
#define PEER_STATUS_CAPABILITY_OPEN (1 << 2) /* capability open send */
-#define PEER_STATUS_HAVE_ACCEPT (1 << 3) /* accept peer's parent */
+#define PEER_STATUS_OPEN_DEFERRED (1 << 3) /* deferred to open_receive */
#define PEER_STATUS_GROUP (1 << 4) /* peer-group conf */
#define PEER_STATUS_NSF_MODE (1 << 5) /* NSF aware peer */
#define PEER_STATUS_NSF_WAIT (1 << 6) /* wait comeback peer */