summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2009-07-28 18:10:55 +0100
committerPaul Jakma <paul@quagga.net>2009-07-28 18:10:55 +0100
commit2158ad2359a370dd349f4543a2d5d535bb5a8770 (patch)
treeafaf6922eecc2f155016e229d516b4e2487c7dbe /bgpd
parentfc4dc59d08589a887ac33a70d946eb7905541f5f (diff)
bgpd/trivial: Fix indentation in previous
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_fsm.c8
-rw-r--r--bgpd/bgpd.c55
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))
{