diff options
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_fsm.c | 8 | ||||
-rw-r--r-- | bgpd/bgpd.c | 55 |
2 files changed, 28 insertions, 35 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 45695895..6121e74a 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -447,10 +447,10 @@ bgp_stop (struct peer *peer) /* Can't do this in Clearing; events are used for state transitions */ if (peer->status != Clearing) - { - /* Delete all existing events of the peer */ - BGP_EVENT_FLUSH (peer); - } + { + /* Delete all existing events of the peer */ + BGP_EVENT_FLUSH (peer); + } /* Increment Dropped count. */ if (peer->status == Established) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 366ee432..01cabae0 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2145,28 +2145,22 @@ peer_lookup (struct bgp *bgp, union sockunion *su) struct listnode *node, *nnode; if (bgp != NULL) - { - for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) { - if (sockunion_same (&peer->su, su) - && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) - return peer; + for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) + if (sockunion_same (&peer->su, su) + && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) + return peer; } - } else if (bm->bgp != NULL) - { - struct listnode *bgpnode, *nbgpnode; - - for(ALL_LIST_ELEMENTS(bm->bgp, bgpnode, nbgpnode, bgp)) { - for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) - { - if (sockunion_same (&peer->su, su) - && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) - return peer; - } + struct listnode *bgpnode, *nbgpnode; + + for (ALL_LIST_ELEMENTS (bm->bgp, bgpnode, nbgpnode, bgp)) + for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) + if (sockunion_same (&peer->su, su) + && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) + return peer; } - } return NULL; } @@ -2182,20 +2176,19 @@ peer_lookup_with_open (union sockunion *su, as_t remote_as, if (! bm->bgp) return NULL; - for(ALL_LIST_ELEMENTS(bm->bgp, bgpnode, nbgpnode, bgp)) - { - for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) - { - if (sockunion_same (&peer->su, su) - && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) - { - if (peer->as == remote_as - && peer->remote_id.s_addr == remote_id->s_addr) - return peer; - if (peer->as == remote_as) - *as = 1; - } - } + for (ALL_LIST_ELEMENTS (bm->bgp, bgpnode, nbgpnode, bgp)) + for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) + { + if (sockunion_same (&peer->su, su) + && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)) + { + if (peer->as == remote_as + && peer->remote_id.s_addr == remote_id->s_addr) + return peer; + if (peer->as == remote_as) + *as = 1; + } + } for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) { |