mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
whitespace cleanup, no binary change.
This commit is contained in:
parent
482a323998
commit
ed520302a6
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: carp.c,v 1.4 2006/06/02 20:09:43 mcbride Exp $ */
|
||||
/* $OpenBSD: carp.c,v 1.5 2006/06/02 20:31:48 moritz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
|
||||
@ -112,7 +112,7 @@ carp_demote(int demote, int force)
|
||||
log_msg(1, "carp_demote: couldn't open socket");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bzero(&ifgr, sizeof(ifgr));
|
||||
strlcpy(ifgr.ifgr_name, cfgstate.carp_ifgroup, sizeof(ifgr.ifgr_name));
|
||||
|
||||
@ -120,11 +120,11 @@ carp_demote(int demote, int force)
|
||||
if (!force) {
|
||||
if (ioctl(s, SIOCGIFGATTR, (caddr_t)&ifgr) == -1) {
|
||||
log_msg(1, "carp_demote: unable to get "
|
||||
"the demote state of group '%s'",
|
||||
cfgstate.carp_ifgroup);
|
||||
"the demote state of group '%s'",
|
||||
cfgstate.carp_ifgroup);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
if (ifgr.ifgr_attrib.ifg_carp_demoted == 0)
|
||||
goto done;
|
||||
}
|
||||
@ -248,7 +248,7 @@ carp_init(void)
|
||||
return -1;
|
||||
}
|
||||
log_msg(1, "carp_init: initializing runstate to %s",
|
||||
carp_state_name(cfgstate.runstate));
|
||||
carp_state_name(cfgstate.runstate));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: conf.y,v 1.10 2006/06/02 20:09:43 mcbride Exp $ */
|
||||
/* $OpenBSD: conf.y,v 1.11 2006/06/02 20:31:48 moritz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
|
||||
@ -59,7 +59,7 @@ void yyerror(const char *);
|
||||
|
||||
%token MODE INTERFACE INTERVAL LISTEN ON PORT PEER SHAREDKEY
|
||||
%token Y_SLAVE Y_MASTER INET INET6 FLUSHMODE STARTUP NEVER SYNC
|
||||
%token GROUP SKIPSLAVE
|
||||
%token GROUP SKIPSLAVE
|
||||
%token <string> STRING
|
||||
%token <val> VALUE
|
||||
%type <val> af port mode flushmode
|
||||
@ -230,7 +230,7 @@ match(char *token)
|
||||
}
|
||||
|
||||
int
|
||||
yylex(void)
|
||||
yylex(void)
|
||||
{
|
||||
char *p;
|
||||
int v;
|
||||
@ -284,7 +284,7 @@ conf_parse_file(char *cfgfile)
|
||||
if ((st.st_uid && st.st_uid != pw->pw_uid) ||
|
||||
((st.st_mode & S_IFMT) != S_IFREG) ||
|
||||
((st.st_mode & (S_IRWXG | S_IRWXO)) != 0)) {
|
||||
log_msg(0, "configuration file has bad owner, type or mode");
|
||||
log_msg(0, "configuration file has bad owner, type or mode");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: monitor.c,v 1.8 2006/06/02 20:09:43 mcbride Exp $ */
|
||||
/* $OpenBSD: monitor.c,v 1.9 2006/06/02 20:31:48 moritz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
|
||||
@ -64,11 +64,11 @@ monitor_init(void)
|
||||
int p[2];
|
||||
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, p) != 0) {
|
||||
log_err("%s: socketpair failed - %s", __progname,
|
||||
log_err("%s: socketpair failed - %s", __progname,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!pw) {
|
||||
log_err("%s: getpwnam(\"%s\") failed", __progname,
|
||||
SASYNCD_USER);
|
||||
@ -97,7 +97,7 @@ monitor_init(void)
|
||||
m_state.s = p[0];
|
||||
close(p[1]);
|
||||
|
||||
if (setgroups(1, &pw->pw_gid) ||
|
||||
if (setgroups(1, &pw->pw_gid) ||
|
||||
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
|
||||
setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) {
|
||||
log_err("%s: failed to drop privileges", __progname);
|
||||
@ -299,7 +299,7 @@ m_priv_pfkey_snap(int s)
|
||||
sadb_buflen = 0;
|
||||
goto try_spd;
|
||||
}
|
||||
|
||||
|
||||
sadb_buflen = sz;
|
||||
if ((sadb_buf = malloc(sadb_buflen)) == NULL) {
|
||||
log_err("m_priv_pfkey_snap: malloc");
|
||||
@ -323,7 +323,7 @@ m_priv_pfkey_snap(int s)
|
||||
spd_buflen = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
spd_buflen = sz;
|
||||
if ((spd_buf = malloc(spd_buflen)) == NULL) {
|
||||
log_err("m_priv_pfkey_snap: malloc");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: net.c,v 1.13 2006/06/02 20:09:43 mcbride Exp $ */
|
||||
/* $OpenBSD: net.c,v 1.14 2006/06/02 20:31:48 moritz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
|
||||
@ -139,7 +139,7 @@ net_add_listener(struct sockaddr *sa)
|
||||
}
|
||||
|
||||
if (getnameinfo(sa, sa->sa_len, host, sizeof host, port, sizeof port,
|
||||
NI_NUMERICHOST | NI_NUMERICSERV))
|
||||
NI_NUMERICHOST | NI_NUMERICSERV))
|
||||
log_msg(3, "listening on port %u fd %d", cfgstate.listen_port,
|
||||
s);
|
||||
else
|
||||
@ -177,13 +177,13 @@ net_setup_listeners(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* If net_set_sa() failed, cfgstate.listen_on is probably an
|
||||
* interface name, so we should listen on all it's addresses.
|
||||
*/
|
||||
|
||||
if (getifaddrs(&ifap) != 0) {
|
||||
perror("net_setup_listeners: getifaddrs()");
|
||||
perror("net_setup_listeners: getifaddrs()");
|
||||
goto errout;
|
||||
}
|
||||
|
||||
@ -683,7 +683,7 @@ net_read(struct syncpeer *p, u_int32_t *msgtype, u_int32_t *msglen)
|
||||
if (r < 1)
|
||||
net_disconnect_peer(p);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
blob_len = ntohl(v);
|
||||
if (blob_len < sizeof hash + AES_IV_LEN + 2 * sizeof(u_int32_t))
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pfkey.c,v 1.14 2006/06/02 20:09:43 mcbride Exp $ */
|
||||
/* $OpenBSD: pfkey.c,v 1.15 2006/06/02 20:31:48 moritz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
|
||||
@ -48,7 +48,7 @@
|
||||
#include "sasyncd.h"
|
||||
#include "net.h"
|
||||
|
||||
struct pfkey_msg
|
||||
struct pfkey_msg
|
||||
{
|
||||
SIMPLEQ_ENTRY(pfkey_msg) next;
|
||||
|
||||
@ -128,7 +128,7 @@ static const char *
|
||||
pfkey_print_type(struct sadb_msg *msg)
|
||||
{
|
||||
static char uk[20];
|
||||
|
||||
|
||||
if (msg->sadb_msg_type < sizeof msgtypes / sizeof msgtypes[0])
|
||||
return msgtypes[msg->sadb_msg_type];
|
||||
else {
|
||||
@ -223,12 +223,12 @@ pfkey_msg_filter(struct sadb_msg *msg)
|
||||
return 1;
|
||||
break;
|
||||
case AF_INET6:
|
||||
if (src &&
|
||||
if (src &&
|
||||
memcmp(&((struct sockaddr_in6 *)p->sa)->sin6_addr,
|
||||
&((struct sockaddr_in6 *)src)->sin6_addr,
|
||||
sizeof(struct in_addr)) == 0)
|
||||
return 1;
|
||||
if (dst &&
|
||||
if (dst &&
|
||||
memcmp(&((struct sockaddr_in6 *)p->sa)->sin6_addr,
|
||||
&((struct sockaddr_in6 *)dst)->sin6_addr,
|
||||
sizeof(struct in_addr)) == 0)
|
||||
@ -454,7 +454,7 @@ pfkey_snapshot(void *v)
|
||||
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
|
||||
if (monitor_get_pfkey_snap(&sadb, &sadbsz, &spd, &spdsz)) {
|
||||
log_msg(0, "pfkey_snapshot: failed to get pfkey snapshot");
|
||||
return;
|
||||
@ -506,7 +506,7 @@ pfkey_snapshot(void *v)
|
||||
|
||||
/* Tweak msg type. */
|
||||
m->sadb_msg_type = SADB_X_ADDFLOW;
|
||||
|
||||
|
||||
if (pfkey_msg_filter(m))
|
||||
continue;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: sasyncd.c,v 1.11 2006/06/02 20:09:43 mcbride Exp $ */
|
||||
/* $OpenBSD: sasyncd.c,v 1.12 2006/06/02 20:31:48 moritz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
|
||||
@ -101,7 +101,7 @@ sasyncd_run(pid_t ppid)
|
||||
|
||||
timeout = &tv;
|
||||
timer_next_event(&tv);
|
||||
|
||||
|
||||
n = select(maxfd, rfds, wfds, 0, timeout);
|
||||
if (n == -1) {
|
||||
if (errno != EINTR) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: timer.c,v 1.2 2005/05/23 19:53:27 ho Exp $ */
|
||||
/* $OpenBSD: timer.c,v 1.3 2006/06/02 20:31:48 moritz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
|
||||
@ -64,7 +64,7 @@ timer_init(void)
|
||||
/*
|
||||
* Return the number of seconds until the next event happens. Used for
|
||||
* the select() call in the main loop.
|
||||
*/
|
||||
*/
|
||||
void
|
||||
timer_next_event(struct timeval *tv)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user