Revision 487c6961 proto/bgp/bgp.c

View differences:

proto/bgp/bgp.c
813 813
      return 0;
814 814
    }
815 815

  
816
  /* We are in proper state and there is no other incoming connection */
816
  /*
817
   * BIRD should keep multiple incoming connections in OpenSent state (for
818
   * details RFC 4271 8.2.1 par 3), but it keeps just one. Duplicate incoming
819
   * connections are rejected istead. The exception is the case where an
820
   * incoming connection triggers a graceful restart.
821
   */
822

  
817 823
  acc = (p->p.proto_state == PS_START || p->p.proto_state == PS_UP) &&
818 824
    (p->start_state >= BSS_CONNECT) && (!p->incoming_conn.sk);
819 825

  
......
823 829
      bgp_handle_graceful_restart(p);
824 830
      bgp_conn_enter_idle_state(p->conn);
825 831
      acc = 1;
832

  
833
      /* There might be separate incoming connection in OpenSent state */
834
      if (p->incoming_conn.state > BS_ACTIVE)
835
	bgp_close_conn(&p->incoming_conn);
826 836
    }
827 837

  
828 838
  BGP_TRACE(D_EVENTS, "Incoming connection from %I%J (port %d) %s",

Also available in: Unified diff