summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2007-02-22 08:34:19 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2007-02-22 08:34:19 +0000
commitb771cf9f9c1b4758ba2b249c62472fbe3442b39f (patch)
treecc7433c70b6f90fb622f6938efb26b6234ca85ea
parent95dc81ae9b9a9ff5088c08b567127f2211d0d58a (diff)
KNF
-rw-r--r--usr.sbin/bgpd/carp.c6
-rw-r--r--usr.sbin/bgpd/kroute.c21
-rw-r--r--usr.sbin/bgpd/parse.y4
-rw-r--r--usr.sbin/bgpd/rde.c8
-rw-r--r--usr.sbin/bgpd/rde_attr.c4
-rw-r--r--usr.sbin/bgpd/rde_prefix.c4
-rw-r--r--usr.sbin/bgpd/rde_rib.c5
-rw-r--r--usr.sbin/bgpd/session.c9
8 files changed, 32 insertions, 29 deletions
diff --git a/usr.sbin/bgpd/carp.c b/usr.sbin/bgpd/carp.c
index 7d619547bff..a4ea1e08a8c 100644
--- a/usr.sbin/bgpd/carp.c
+++ b/usr.sbin/bgpd/carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: carp.c,v 1.3 2006/06/19 12:06:24 henning Exp $ */
+/* $OpenBSD: carp.c,v 1.4 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@@ -70,7 +70,7 @@ carp_demote_init(char *group, int force)
free(c);
return (-1);
}
-
+
/* only demote if this group already is demoted */
if ((level = carp_demote_get(group)) == -1)
return (-1);
@@ -176,6 +176,6 @@ carp_demote_ioctl(char *group, int demote)
log_info("%s the demote state of group '%s'",
(demote > 0) ? "incremented" : "decremented", group);
- close (s);
+ close(s);
return (res);
}
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index 9cead46f996..de12fc67f11 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.151 2007/02/07 13:22:55 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.152 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -759,10 +759,10 @@ kr_reload(void)
LIST_FOREACH(rn, &redistlist, entry)
if (bgpd_redistribute(IMSG_NETWORK_ADD, rn->kr, rn->kr6) == -1)
return (-1);
-
+
RB_FOREACH(nh, knexthop_tree, &knt)
knexthop_validate(nh);
-
+
return (0);
}
@@ -2032,7 +2032,8 @@ fetchtable(u_int rtableid, int connected_only)
if (rtm->rtm_flags & RTF_PROTO1) {
send_rtmsg(kr_state.fd, RTM_DELETE, &kr->r);
free(kr);
- } else if (connected_only && !(kr->r.flags & F_CONNECTED))
+ } else if (connected_only &&
+ !(kr->r.flags & F_CONNECTED))
free(kr);
else
kroute_insert(kr);
@@ -2040,7 +2041,8 @@ fetchtable(u_int rtableid, int connected_only)
if (rtm->rtm_flags & RTF_PROTO1) {
send_rt6msg(kr_state.fd, RTM_DELETE, &kr6->r);
free(kr6);
- } else if (connected_only && !(kr6->r.flags & F_CONNECTED))
+ } else if (connected_only &&
+ !(kr6->r.flags & F_CONNECTED))
free(kr6);
else
kroute6_insert(kr6);
@@ -2154,13 +2156,13 @@ dispatch_rtmsg(void)
sa = (struct sockaddr *)(rtm + 1);
get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
- if (rtm->rtm_pid == kr_state.pid) /* cause by us */
+ if (rtm->rtm_pid == kr_state.pid) /* cause by us */
continue;
- if (rtm->rtm_errno) /* failed attempts... */
+ if (rtm->rtm_errno) /* failed attempts */
continue;
- if (rtm->rtm_flags & RTF_LLINFO) /* arp cache */
+ if (rtm->rtm_flags & RTF_LLINFO) /* arp cache */
continue;
connected_only = 0;
@@ -2171,7 +2173,8 @@ dispatch_rtmsg(void)
continue;
}
- if (dispatch_rtmsg_addr(rtm, rti_info, connected_only) == -1)
+ if (dispatch_rtmsg_addr(rtm, rti_info,
+ connected_only) == -1)
return (-1);
break;
case RTM_IFINFO:
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 556ffe943f3..74c3ebaee02 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.199 2007/01/26 21:34:21 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.200 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2142,7 +2142,7 @@ symget(const char *nam)
int
getcommunity(char *s)
{
- int val;
+ int val;
const char *errstr;
if (strcmp(s, "*") == 0)
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index c5b7ae7ebf9..8a1723ff3cb 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.218 2007/01/26 17:40:49 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.219 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1669,7 +1669,7 @@ rde_dump_filter(struct prefix *p, struct ctl_show_rib_request *req)
return;
if (req->peerid) {
- if ((peer = peer_get(req->peerid)) != NULL)
+ if ((peer = peer_get(req->peerid)) != NULL)
rde_dump_filterout(peer, p, req);
return;
}
@@ -1771,7 +1771,7 @@ rde_dump_runner(void)
{
struct rde_dump_ctx *ctx, *next;
- for(ctx = TAILQ_FIRST(&rde_dump_h); ctx != NULL; ctx = next) {
+ for (ctx = TAILQ_FIRST(&rde_dump_h); ctx != NULL; ctx = next) {
next = TAILQ_NEXT(ctx, entry);
if (ctx->ptc.done) {
imsg_compose(ibuf_se_ctl, IMSG_CTL_END, 0, ctx->req.pid,
@@ -1995,7 +1995,7 @@ rde_softreconfig_in(struct pt_entry *pt, void *ptr)
struct bgpd_addr addr;
pt_getaddr(pt, &addr);
- for(p = LIST_FIRST(&pt->prefix_h); p != NULL; p = np) {
+ for (p = LIST_FIRST(&pt->prefix_h); p != NULL; p = np) {
np = LIST_NEXT(p, prefix_l);
if (!(p->flags & F_ORIGINAL))
continue;
diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c
index f27cc53950e..290e29dcb79 100644
--- a/usr.sbin/bgpd/rde_attr.c
+++ b/usr.sbin/bgpd/rde_attr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_attr.c,v 1.68 2006/12/21 15:25:19 claudio Exp $ */
+/* $OpenBSD: rde_attr.c,v 1.69 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -794,7 +794,7 @@ community_delete(struct rde_aspath *asp, int as, int type)
if (attr == NULL)
/* no attr nothing to do */
return;
-
+
p = attr->data;
for (l = 0; l < attr->len; l += 4) {
eas = *p++;
diff --git a/usr.sbin/bgpd/rde_prefix.c b/usr.sbin/bgpd/rde_prefix.c
index 335764b5557..85f4a4907c6 100644
--- a/usr.sbin/bgpd/rde_prefix.c
+++ b/usr.sbin/bgpd/rde_prefix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_prefix.c,v 1.23 2007/01/26 17:40:49 claudio Exp $ */
+/* $OpenBSD: rde_prefix.c,v 1.24 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -402,7 +402,7 @@ pt_restart(struct pt_context *ctx)
*/
if (comp < 0)
return (prev);
-
+
/* backtrack until parent is bigger */
do {
prev = RB_PARENT(prev, pt_e);
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c
index 66aba9fd620..36636b6a591 100644
--- a/usr.sbin/bgpd/rde_rib.c
+++ b/usr.sbin/bgpd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.92 2007/01/11 22:00:17 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.93 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -90,7 +90,6 @@ path_update(struct rde_peer *peer, struct rde_aspath *nasp,
struct rde_aspath *asp;
struct prefix *p, *oldp = NULL;
-
if (flags & F_LOCAL) {
rde_send_pftable(nasp->pftableid, prefix, prefixlen, 0);
rde_send_pftable_commit();
@@ -810,7 +809,7 @@ nexthop_shutdown(void)
struct nexthop *nh, *nnh;
for (i = 0; i <= nexthoptable.nexthop_hashmask; i++) {
- for(nh = LIST_FIRST(&nexthoptable.nexthop_hashtbl[i]);
+ for (nh = LIST_FIRST(&nexthoptable.nexthop_hashtbl[i]);
nh != NULL; nh = nnh) {
nnh = LIST_NEXT(nh, nexthop_l);
nh->state = NEXTHOP_UNREACH;
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index c8899b7d370..1440ddd8c46 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.269 2007/02/22 08:26:45 henning Exp $ */
+/* $OpenBSD: session.c,v 1.270 2007/02/22 08:34:18 henning Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -939,7 +939,8 @@ change_state(struct peer *peer, enum session_state state,
peer->IdleHoldTime < MAX_IDLE_HOLD/2)
peer->IdleHoldTime *= 2;
}
- if (peer->state == STATE_NONE || peer->state == STATE_ESTABLISHED) {
+ if (peer->state == STATE_NONE ||
+ peer->state == STATE_ESTABLISHED) {
/* initialize capability negotiation structures */
memcpy(&peer->capa.ann, &peer->conf.capabilities,
sizeof(peer->capa.ann));
@@ -1353,7 +1354,7 @@ session_open(struct peer *p)
if ((opb = buf_open(0)) == NULL) {
bgp_fsm(p, EVNT_CON_FATAL);
return;
- }
+ }
/* multiprotocol extensions, RFC 2858 */
if (p->capa.ann.mp_v4) { /* 4 bytes data */
@@ -1384,7 +1385,7 @@ session_open(struct peer *p)
buf_free(opb);
bgp_fsm(p, EVNT_CON_FATAL);
return;
- }
+ }
msg.version = 4;
msg.myas = htons(conf->as);