]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix O_NONBLOCK on outgoing connects
authorVipin Kumar <vipin@cumulusnetworks.com>
Thu, 9 Jan 2014 00:31:22 +0000 (00:31 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Thu, 15 May 2014 18:27:12 +0000 (20:27 +0200)
BGP was setting sockets to be non-blocking only for the accepted passive
peers.  As a fix, setting the BGP sockets to be non-blocking even for
the active peers.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
[DL: patch split, this is item 1.]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_network.c

index 79d5d27d0f45e5332345c387ddde3ba211c0b3f8..bcaaba759b894b5460b3dd560ebd153f6e46e72f 100644 (file)
@@ -306,6 +306,8 @@ bgp_connect (struct peer *peer)
   if (peer->fd < 0)
     return -1;
 
+  set_nonblocking (peer->fd);
+
   /* If we can get socket for the peer, adjest TTL and make connection. */
   if (peer->sort == BGP_PEER_EBGP) {
     sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);