summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-06-17 13:35:44 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-06-17 13:35:44 +0000
commite847d6210932c69e6a8643d976b54a2d397b12be (patch)
tree72b2f313adbb9fbd9c9099916f6cf546f95dd2e2 /usr.sbin
parentf30932ff8d939a9655e915d631d1aa0e0ec47060 (diff)
Cleanup, remove some unneded spaces add some other where needed.
No binary change according to clang
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/bgpd.h4
-rw-r--r--usr.sbin/bgpd/parse.y28
-rw-r--r--usr.sbin/bgpd/pfkey.c3
-rw-r--r--usr.sbin/bgpd/printconf.c4
-rw-r--r--usr.sbin/bgpd/rde.c10
-rw-r--r--usr.sbin/bgpd/rde.h10
-rw-r--r--usr.sbin/bgpd/session.c6
-rw-r--r--usr.sbin/bgpd/util.c4
8 files changed, 34 insertions, 35 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index a4f34e1f351..81b7f66823d 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.385 2019/06/17 11:02:19 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.386 2019/06/17 13:35:42 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1263,7 +1263,7 @@ void as_sets_mark_dirty(struct as_set_head *, struct as_set_head *);
int as_set_match(const struct as_set *, u_int32_t);
struct set_table *set_new(size_t, size_t);
-void set_free(struct set_table *);
+void set_free(struct set_table *);
int set_add(struct set_table *, void *, size_t);
void *set_get(struct set_table *, size_t *);
void set_prep(struct set_table *);
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index f9e7d405191..d7630c51bc8 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.390 2019/06/17 11:02:19 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.391 2019/06/17 13:35:42 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -54,7 +54,7 @@ static struct file {
TAILQ_ENTRY(file) entry;
FILE *stream;
char *name;
- size_t ungetpos;
+ size_t ungetpos;
size_t ungetsize;
u_char *ungetbuf;
int eof_reached;
@@ -1198,7 +1198,7 @@ neighbor : { curpeer = new_peer(); }
}
;
-group : GROUP string {
+group : GROUP string {
curgroup = curpeer = new_group();
if (strlcpy(curgroup->conf.group, $2,
sizeof(curgroup->conf.group)) >=
@@ -1309,7 +1309,7 @@ peeropts : REMOTEAS as4number {
sizeof(curpeer->conf.rib)) >=
sizeof(curpeer->conf.rib)) {
yyerror("rib name \"%s\" too long: max %zu",
- $2, sizeof(curpeer->conf.rib) - 1);
+ $2, sizeof(curpeer->conf.rib) - 1);
free($2);
YYERROR;
}
@@ -1341,7 +1341,7 @@ peeropts : REMOTEAS as4number {
afi != $2)
continue;
curpeer->conf.capabilities.mp[aid] = 0;
- }
+ }
} else {
if (afi2aid($2, $3, &aid) == -1) {
yyerror("unknown AFI/SAFI pair");
@@ -1813,7 +1813,7 @@ filter_peer : ANY {
YYERROR;
}
}
- | AS as4number {
+ | AS as4number {
if (($$ = calloc(1, sizeof(struct filter_peers_l))) ==
NULL)
fatal(NULL);
@@ -2152,7 +2152,7 @@ filter_elm : filter_prefix_h {
}
free($3);
}
- | NEXTHOP address {
+ | NEXTHOP address {
if (fmopts.m.nexthop.flags) {
yyerror("nexthop already specified");
YYERROR;
@@ -2160,7 +2160,7 @@ filter_elm : filter_prefix_h {
fmopts.m.nexthop.addr = $2;
fmopts.m.nexthop.flags = FILTER_NEXTHOP_ADDR;
}
- | NEXTHOP NEIGHBOR {
+ | NEXTHOP NEIGHBOR {
if (fmopts.m.nexthop.flags) {
yyerror("nexthop already specified");
YYERROR;
@@ -3257,7 +3257,7 @@ parse_config(char *filename, struct peer_head *ph)
{
struct sym *sym, *next;
struct rde_rib *rr;
- struct network *n;
+ struct network *n;
int errors = 0;
conf = new_config();
@@ -3302,7 +3302,7 @@ parse_config(char *filename, struct peer_head *ph)
"%d is not allowed.",
n->net.priority, conf->fib_priority);
}
-
+
/* Free macros and check which have not been used. */
TAILQ_FOREACH_SAFE(sym, &symhead, entry, next) {
if ((cmd_opts & BGPD_OPT_VERBOSE2) && !sym->used)
@@ -3573,7 +3573,7 @@ parsesubtype(char *name, int *type, int *subtype)
static int
parseextvalue(int type, char *s, u_int32_t *v, u_int32_t *flag)
{
- const char *errstr;
+ const char *errstr;
char *p;
struct in_addr ip;
u_int32_t uvalh, uval;
@@ -3749,7 +3749,7 @@ parseextcommunity(struct community *c, char *t, char *s)
c->flags |= dflag1 << 8;
return (0);
}
-
+
/* verify type/subtype combo */
for (cp = iana_ext_comms; cp->subname != NULL; cp++) {
if (cp->type == type && cp->subtype == subtype) {
@@ -3899,7 +3899,7 @@ add_rib(char *name, u_int rtableid, u_int16_t flags)
}
if (strlcpy(rr->name, name, sizeof(rr->name)) >= sizeof(rr->name)) {
yyerror("rib name \"%s\" too long: max %zu",
- name, sizeof(rr->name) - 1);
+ name, sizeof(rr->name) - 1);
free(rr);
return (-1);
}
@@ -4356,7 +4356,7 @@ optimize_filters(struct filter_head *fh)
while (filter_equal(r, nr)) {
struct filter_set *t;
- while((t = TAILQ_FIRST(&nr->set)) != NULL) {
+ while ((t = TAILQ_FIRST(&nr->set)) != NULL) {
TAILQ_REMOVE(&nr->set, t, entry);
filterset_add(&r->set, t);
}
diff --git a/usr.sbin/bgpd/pfkey.c b/usr.sbin/bgpd/pfkey.c
index 3db0ff0efae..9e7cb9be27b 100644
--- a/usr.sbin/bgpd/pfkey.c
+++ b/usr.sbin/bgpd/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.56 2019/05/29 08:48:00 claudio Exp $ */
+/* $OpenBSD: pfkey.c,v 1.57 2019/06/17 13:35:43 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -850,7 +850,6 @@ tcp_md5_set(int fd, struct peer *p)
return 0;
}
-
int
tcp_md5_listen(int fd, struct peer_head *p)
{
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c
index 5ed4fdad9f2..5ccad43a132 100644
--- a/usr.sbin/bgpd/printconf.c
+++ b/usr.sbin/bgpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.136 2019/06/17 11:02:19 claudio Exp $ */
+/* $OpenBSD: printconf.c,v 1.137 2019/06/17 13:35:43 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -742,7 +742,7 @@ print_as(struct filter_rule *r)
printf("as-set \"%s\" ", r->match.as.name);
return;
}
- switch(r->match.as.op) {
+ switch (r->match.as.op) {
case OP_RANGE:
printf("%s - ", log_as(r->match.as.as_min));
printf("%s ", log_as(r->match.as.as_max));
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 3ab572ab5c5..58588a93127 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.469 2019/06/17 11:02:19 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.470 2019/06/17 13:35:43 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2049,8 +2049,8 @@ rde_update_log(const char *message, u_int16_t rid,
char *n = NULL;
char *p = NULL;
- if ( !((conf->log & BGPD_LOG_UPDATES) ||
- (peer->conf.flags & PEERFLAG_LOG_UPDATES)) )
+ if (!((conf->log & BGPD_LOG_UPDATES) ||
+ (peer->conf.flags & PEERFLAG_LOG_UPDATES)))
return;
if (next != NULL)
@@ -3547,7 +3547,7 @@ peer_flush_upcall(struct rib_entry *re, void *arg)
time_t staletime = ((struct peer_flush *)arg)->staletime;
u_int32_t i;
u_int8_t prefixlen;
-
+
pt_getaddr(re->prefix, &addr);
prefixlen = re->prefix->prefixlen;
LIST_FOREACH_SAFE(p, &re->prefix_h, rib_l, np) {
@@ -3919,7 +3919,7 @@ network_flush_upcall(struct rib_entry *re, void *ptr)
struct prefix *p, *np, *rp;
u_int32_t i;
u_int8_t prefixlen;
-
+
pt_getaddr(re->prefix, &addr);
prefixlen = re->prefix->prefixlen;
LIST_FOREACH_SAFE(p, &re->prefix_h, rib_l, np) {
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h
index 44711869702..36fff8e2bf3 100644
--- a/usr.sbin/bgpd/rde.h
+++ b/usr.sbin/bgpd/rde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.h,v 1.213 2019/06/17 11:02:19 claudio Exp $ */
+/* $OpenBSD: rde.h,v 1.214 2019/06/17 13:35:43 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and
@@ -180,7 +180,7 @@ struct rde_community {
size_t nentries;
int flags;
int refcnt;
- struct community *communities;
+ struct community *communities;
};
#define PARTIAL_COMMUNITIES 0x01
@@ -410,7 +410,7 @@ void communities_shutdown(void);
void communities_hash_stats(struct rde_hashstats *);
struct rde_community *communities_lookup(struct rde_community *);
struct rde_community *communities_link(struct rde_community *);
-void communities_unlink(struct rde_community *);
+void communities_unlink(struct rde_community *);
int communities_equal(struct rde_community *, struct rde_community *);
void communities_copy(struct rde_community *, struct rde_community *);
@@ -501,8 +501,8 @@ struct rib_entry *rib_lookup(struct rib *, struct bgpd_addr *);
int rib_dump_pending(void);
void rib_dump_runner(void);
int rib_dump_new(u_int16_t, u_int8_t, unsigned int, void *,
- void (*)(struct rib_entry *, void *),
- void (*)(void *, u_int8_t),
+ void (*)(struct rib_entry *, void *),
+ void (*)(void *, u_int8_t),
int (*)(void *));
void rib_dump_terminate(u_int16_t, void *,
void (*)(struct rib_entry *, void *));
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 267c18dea1f..509f85a30ac 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.383 2019/06/17 11:02:20 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.384 2019/06/17 13:35:43 claudio Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -2270,7 +2270,7 @@ parse_notification(struct peer *peer)
if (datalen > 1) {
shutcomm_len = *p++;
datalen--;
- if(datalen < shutcomm_len) {
+ if (datalen < shutcomm_len) {
log_peer_warnx(&peer->conf,
"received truncated shutdown reason");
return (0);
@@ -2555,7 +2555,7 @@ session_dispatch_imsg(struct imsgbuf *ibuf, int idx, u_int *listener_cnt)
fatalx("reconf request not from parent");
nconf = new_config();
- copy_config(nconf, imsg.data);
+ copy_config(nconf, imsg.data);
pending_reconf = 1;
break;
case IMSG_RECONF_PEER:
diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c
index 14df35f6068..4ec98fd9b16 100644
--- a/usr.sbin/bgpd/util.c
+++ b/usr.sbin/bgpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.49 2019/04/10 15:21:54 claudio Exp $ */
+/* $OpenBSD: util.c,v 1.50 2019/06/17 13:35:43 claudio Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -52,7 +52,7 @@ log_addr(const struct bgpd_addr *addr)
sizeof(tbuf)) == NULL)
return ("?");
snprintf(buf, sizeof(buf), "%s %s", log_rd(addr->vpn4.rd),
- tbuf);
+ tbuf);
return (buf);
case AID_VPN_IPv6:
if (inet_ntop(aid2af(addr->aid), &addr->vpn6.addr, tbuf,