summaryrefslogtreecommitdiff
path: root/bgpd/bgpd.c
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/bgpd.c
parentfc4dc59d08589a887ac33a70d946eb7905541f5f (diff)
bgpd/trivial: Fix indentation in previous
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c55
1 files changed, 24 insertions, 31 deletions
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))
{