summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-17 18:11:32 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-17 18:11:32 +0000
commitd17ca583628738de2f82b146975342e5f16da78b (patch)
tree469e31b6b3c2d12aca4a5a93fe8e1e752626be3c /usr.sbin
parent82b99a89e16ddf4a7c201c5e53c1eb78b421861f (diff)
style
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/ensure.h5
-rw-r--r--usr.sbin/bgpd/log.c12
-rw-r--r--usr.sbin/bgpd/mrt.h5
-rw-r--r--usr.sbin/bgpd/parse.y4
-rw-r--r--usr.sbin/bgpd/rde.c18
-rw-r--r--usr.sbin/bgpd/session.c24
6 files changed, 31 insertions, 37 deletions
diff --git a/usr.sbin/bgpd/ensure.h b/usr.sbin/bgpd/ensure.h
index 5b17c6e194a..139e906c95a 100644
--- a/usr.sbin/bgpd/ensure.h
+++ b/usr.sbin/bgpd/ensure.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ensure.h,v 1.1 2003/12/17 11:46:54 henning Exp $ */
+/* $OpenBSD: ensure.h,v 1.2 2003/12/17 18:11:31 henning Exp $ */
/*
* Copyright (c) 2003 Claudio Jeker <cjeker@diehard.n-r-g.com>
@@ -24,8 +24,7 @@
#if CHECK_ENSURE != 0
#define ENSURE(cond) \
- ((void) ((cond) || \
- (fatal_ensure(__FILE__, __LINE__, #cond), 0)))
+ ((void) ((cond) || (fatal_ensure(__FILE__, __LINE__, #cond), 0)))
#else
#define ENSURE(cond)
#endif
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c
index 6fbec30818e..b3ee25824e3 100644
--- a/usr.sbin/bgpd/log.c
+++ b/usr.sbin/bgpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.1 2003/12/17 11:46:54 henning Exp $ */
+/* $OpenBSD: log.c,v 1.2 2003/12/17 18:11:31 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -114,7 +114,7 @@ log_fmt_peer(struct peer *peer)
ip = inet_ntoa(peer->conf.remote_addr.sin_addr);
if (peer->conf.descr[0]) {
if (asprintf(&pfmt, "neighbor %s (%s)", ip, peer->conf.descr) ==
- -1)
+ -1)
fatal(NULL, errno);
} else {
if (asprintf(&pfmt, "neighbor %s", ip) == -1)
@@ -171,7 +171,7 @@ log_err(struct peer *peer, const char *emsg, ...)
va_start(ap, emsg);
vlog(LOG_CRIT, nfmt, ap);
va_end(ap);
- free (p);
+ free(p);
}
void
@@ -186,7 +186,7 @@ log_errx(struct peer *peer, const char *emsg, ...)
va_start(ap, emsg);
vlog(LOG_CRIT, nfmt, ap);
va_end(ap);
- free (p);
+ free(p);
}
void
@@ -202,7 +202,7 @@ fatal(const char *emsg, int error)
/* XXX check which process we are and notify others! */
sleep(10);
- _exit (1);
+ _exit(1);
}
void
@@ -213,7 +213,7 @@ fatal_ensure(const char *file, int line, const char *cond)
/* XXX check which process we are and notify others! */
sleep(10);
- _exit (1);
+ _exit(1);
}
void
diff --git a/usr.sbin/bgpd/mrt.h b/usr.sbin/bgpd/mrt.h
index 95f6bb63600..837661e760a 100644
--- a/usr.sbin/bgpd/mrt.h
+++ b/usr.sbin/bgpd/mrt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mrt.h,v 1.1 2003/12/17 11:46:54 henning Exp $ */
+/* $OpenBSD: mrt.h,v 1.2 2003/12/17 18:11:31 henning Exp $ */
/*
* Copyright (c) 2003 Claudio Jeker <cjeker@diehard.n-r-g.com>
@@ -55,8 +55,7 @@ enum MRT_MSG_TYPES {
};
#define MRT_HEADER_SIZE sizeof(struct mrt_header)
-#define MRT_DUMP_HEADER_SIZE \
- /* sizeof(struct mrt_dump_v4_header) */ 22
+#define MRT_DUMP_HEADER_SIZE 22 /* sizeof(struct mrt_dump_v4_header) */
#define MRT_BGP4MP_HEADER_SIZE \
sizeof(struct mrt_bgp4mp_header) + \
sizeof(struct mrt_bgp4mp_IPv4)
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 89bda6908c2..a16f53fabe7 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.1 2003/12/17 11:46:54 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.2 2003/12/17 18:11:31 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -759,7 +759,7 @@ check_state_main(void)
{
if (pstate != PSTATE_MAIN) {
yyerror("This statement is only valid outside "
- "group or neighbor definitions");
+ "group or neighbor definitions");
return (-1);
} else
return (0);
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 33ca6b0e42e..0ad75456eba 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.1 2003/12/17 11:46:54 henning Exp $ */
+/* $OpenBSD: rde.c,v 1.2 2003/12/17 18:11:31 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -88,17 +88,15 @@ rde_main(struct bgpd_config *config, int pipe_m2r[2], int pipe_s2r[2])
switch (pid = fork()) {
case -1:
fatal("cannot fork", errno);
-
- case 0:
- break;
-
- default:
- return (pid);
- }
+ case 0:
+ break;
+ default:
+ return (pid);
+ }
if (chroot(pw->pw_dir) < 0)
fatal("chroot failed", errno);
- chdir ("/");
+ chdir("/");
setproctitle("route decision engine");
if (setgroups(1, &pw->pw_gid) ||
@@ -164,7 +162,7 @@ rde_main(struct bgpd_config *config, int pipe_m2r[2], int pipe_s2r[2])
}
logit(LOG_INFO, "route decision engine exiting");
- _exit (0);
+ _exit(0);
}
void
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 8bcb4c5b1f5..da68b2a1050 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.1 2003/12/17 11:46:54 henning Exp $ */
+/* $OpenBSD: session.c,v 1.2 2003/12/17 18:11:31 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -149,17 +149,15 @@ session_main(struct bgpd_config *config, int pipe_m2s[2], int pipe_s2r[2])
switch (pid = fork()) {
case -1:
fatal("cannot fork", errno);
-
- case 0:
- break;
-
- default:
- return (pid);
- }
+ case 0:
+ break;
+ default:
+ return (pid);
+ }
if (chroot(pw->pw_dir) < 0)
fatal("chroot failed", errno);
- chdir ("/");
+ chdir("/");
setproctitle("session engine");
if ((sock = setup_listener()) < 0)
@@ -291,7 +289,7 @@ session_main(struct bgpd_config *config, int pipe_m2s[2], int pipe_s2r[2])
shutdown(sock, SHUT_RDWR);
close(sock);
logit(LOG_INFO, "session engine exiting");
- _exit (0);
+ _exit(0);
}
void
@@ -828,7 +826,7 @@ void
session_notification(struct peer *peer, u_int8_t errcode, u_int8_t subcode,
u_char *data, size_t datalen)
{
- struct msg_notification msg;
+ struct msg_notification msg;
struct buf *buf;
size_t len;
int errs = 0;
@@ -1203,7 +1201,7 @@ session_dispatch_imsg(int fd, int idx)
int reconf;
if (get_imsg(fd, &imsg) > 0) {
- switch(imsg.hdr.type) {
+ switch (imsg.hdr.type) {
case IMSG_RECONF_CONF:
if (idx != PFD_PIPE_MAIN)
fatal("reconf request not from parent", 0);
@@ -1277,7 +1275,7 @@ session_dispatch_imsg(int fd, int idx)
for (p = conf->peers; p != NULL; p = p->next)
if (p->conf.reconf_action == RECONF_NONE)
p->conf.reconf_action = RECONF_DELETE;
- free (nconf);
+ free(nconf);
pending_reconf = 0;
logit(LOG_INFO, "got new configuration");
break;