diff options
Diffstat (limited to 'src/starter')
-rw-r--r-- | src/starter/args.c | 6 | ||||
-rw-r--r-- | src/starter/confread.c | 32 | ||||
-rw-r--r-- | src/starter/confread.h | 4 | ||||
-rw-r--r-- | src/starter/invokecharon.c | 4 | ||||
-rw-r--r-- | src/starter/invokepluto.c | 6 | ||||
-rw-r--r-- | src/starter/klips.c | 4 | ||||
-rw-r--r-- | src/starter/klips.h | 2 | ||||
-rw-r--r-- | src/starter/netkey.h | 2 | ||||
-rw-r--r-- | src/starter/starter.c | 14 | ||||
-rw-r--r-- | src/starter/starterstroke.c | 12 | ||||
-rw-r--r-- | src/starter/starterwhack.c | 6 |
11 files changed, 46 insertions, 46 deletions
diff --git a/src/starter/args.c b/src/starter/args.c index f01f3e97f..b648d40ee 100644 --- a/src/starter/args.c +++ b/src/starter/args.c @@ -396,7 +396,7 @@ bool assign_arg(kw_token_t token, kw_token_t first, kw_list_t *kw, char *base, case ARG_UINT: { char *endptr; - u_int *u = (u_int *)p; + u_int *u = (u_int *)p; *u = strtoul(kw->value, &endptr, 10); @@ -509,12 +509,12 @@ bool assign_arg(kw_token_t token, kw_token_t first, kw_list_t *kw, char *base, { char ** lst; - for (lst = *listp; lst && *lst; lst++) + for (lst = *listp; lst && *lst; lst++) { bool match = FALSE; list = token_info[token].list; - + while (*list != NULL && !match) { match = streq(*lst, *list++); diff --git a/src/starter/confread.c b/src/starter/confread.c index 5fd2b9fbf..ef27ce893 100644 --- a/src/starter/confread.c +++ b/src/starter/confread.c @@ -119,7 +119,7 @@ load_setup(starter_config_t *cfg, config_parsed_t *cfgp) bool assigned = FALSE; kw_token_t token = kw->entry->token; - + if (token < KW_SETUP_FIRST || token > KW_SETUP_LAST) { plog("# unsupported keyword '%s' in config setup", kw->entry->name); @@ -165,10 +165,10 @@ kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token ip_subnet net; char *pos; int len = 0; - + end->has_client = TRUE; conn->tunnel_addr_family = ip_version(value); - + pos = strchr(value, ','); if (pos) { @@ -199,7 +199,7 @@ kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token { ip_address addr; ip_subnet net; - + conn->tunnel_addr_family = ip_version(value); if (strchr(value, '/')) { /* CIDR notation, address pool */ @@ -323,7 +323,7 @@ kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token case KW_SUBNETWITHIN: { ip_subnet net; - + end->has_client = TRUE; end->has_client_wildcard = TRUE; conn->tunnel_addr_family = ip_version(value); @@ -350,7 +350,7 @@ kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token if (streq(value, "%defaultroute")) { char buf[64]; - + if (cfg->defaultroute.defined) { addrtot(&cfg->defaultroute.addr, 0, buf, sizeof(buf)); @@ -365,7 +365,7 @@ kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token else { ip_address addr; - + conn->tunnel_addr_family = ip_version(value); ugh = ttoaddr(value, 0, conn->tunnel_addr_family, &addr); if (ugh != NULL) @@ -510,8 +510,8 @@ load_conn(starter_conn_t *conn, kw_list_t *kw, starter_config_t *cfg) } else if (streq(kw->value, "transport_proxy")) { - conn->policy |= POLICY_PROXY; - } + conn->policy |= POLICY_PROXY; + } else if (streq(kw->value, "passthrough") || streq(kw->value, "pass")) { conn->policy |= POLICY_SHUNT_PASS; @@ -535,10 +535,10 @@ load_conn(starter_conn_t *conn, kw_list_t *kw, starter_config_t *cfg) break; case KW_COMPRESS: KW_POLICY_FLAG("yes", "no", POLICY_COMPRESS) - break; + break; case KW_AUTH: KW_POLICY_FLAG("ah", "esp", POLICY_AUTHENTICATE) - break; + break; case KW_AUTHBY: conn->policy &= ~(POLICY_ID_AUTH_MASK | POLICY_ENCRYPT); @@ -591,7 +591,7 @@ load_conn(starter_conn_t *conn, kw_list_t *kw, starter_config_t *cfg) case KW_EAP: { char *sep; - + /* check for vendor-type format */ sep = strchr(kw->value, '-'); if (sep) @@ -922,7 +922,7 @@ confread_free_ca(starter_ca_t *ca) /* * free the memory used by a starter_config_t object */ -void +void confread_free(starter_config_t *cfg) { starter_conn_t *conn = cfg->conn_first; @@ -1046,7 +1046,7 @@ confread_load(const char *file) for (ca = cfg->ca_first; ca; ca = ca->next) { also_t *also = ca->also; - + while (also != NULL) { kw_list_t *kw = find_also_ca(also->name, cfg->ca_first, cfg); @@ -1080,7 +1080,7 @@ confread_load(const char *file) for (sconn = cfgp->conn_first; sconn; sconn = sconn->next) { u_int previous_err; - + /* skip %default conn section */ if (streq(sconn->name, "%default")) continue; @@ -1093,7 +1093,7 @@ confread_load(const char *file) conn_default(sconn->name, conn, &cfg->conn_default); conn->kw = sconn->kw; conn->next = NULL; - + previous_err = cfg->err; load_conn(conn, conn->kw, cfg); if (cfg->err > previous_err) diff --git a/src/starter/confread.h b/src/starter/confread.h index 2f789e976..9fc11382e 100644 --- a/src/starter/confread.h +++ b/src/starter/confread.h @@ -128,12 +128,12 @@ struct starter_conn { char *esp; char *ike; char *pfsgroup; - + time_t dpd_delay; time_t dpd_timeout; dpd_action_t dpd_action; int dpd_count; - + bool me_mediation; char *me_mediated_by; char *me_peerid; diff --git a/src/starter/invokecharon.c b/src/starter/invokecharon.c index 1eb2a0332..f8aa5e6a9 100644 --- a/src/starter/invokecharon.c +++ b/src/starter/invokecharon.c @@ -127,7 +127,7 @@ int starter_start_charon (starter_config_t *cfg, bool no_fork, bool attach_gdb) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - + if (attach_gdb) { argc = 0; @@ -163,7 +163,7 @@ int starter_start_charon (starter_config_t *cfg, bool no_fork, bool attach_gdb) { break; } - + /* get next */ pos = strchr(pos, ','); if (pos) diff --git a/src/starter/invokepluto.c b/src/starter/invokepluto.c index 08fb0657a..f91f4b6c9 100644 --- a/src/starter/invokepluto.c +++ b/src/starter/invokepluto.c @@ -94,7 +94,7 @@ starter_stop_pluto (void) /* be more and more aggressive */ for (i = 0; i < 20 && (pid = _pluto_pid) != 0; i++) { - + if (i < 10) { kill(pid, SIGTERM); @@ -103,7 +103,7 @@ starter_stop_pluto (void) { kill(pid, SIGKILL); plog("starter_stop_pluto(): pluto does not respond, sending KILL"); - } + } else { kill(pid, SIGKILL); @@ -147,7 +147,7 @@ starter_start_pluto (starter_config_t *cfg, bool no_fork, bool attach_gdb) }; printf ("starter_start_pluto entered\n"); - + if (attach_gdb) { argc = 0; diff --git a/src/starter/klips.c b/src/starter/klips.c index 061dee50c..79bd25c44 100644 --- a/src/starter/klips.c +++ b/src/starter/klips.c @@ -46,7 +46,7 @@ starter_klips_init(void) return FALSE; } } - + /* load crypto algorithm modules */ ignore_result(system("modprobe -qv ipsec_aes")); ignore_result(system("modprobe -qv ipsec_blowfish")); @@ -55,7 +55,7 @@ starter_klips_init(void) DBG(DBG_CONTROL, DBG_log("Found KLIPS IPsec stack") ) - + return TRUE; } diff --git a/src/starter/klips.h b/src/starter/klips.h index e93348df1..1a527d108 100644 --- a/src/starter/klips.h +++ b/src/starter/klips.h @@ -1,4 +1,4 @@ -/* strongSwan KLIPS initialization and cleanup +/* strongSwan KLIPS initialization and cleanup * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security * * This program is free software; you can redistribute it and/or modify it diff --git a/src/starter/netkey.h b/src/starter/netkey.h index 55f6a7c47..c12924174 100644 --- a/src/starter/netkey.h +++ b/src/starter/netkey.h @@ -1,4 +1,4 @@ -/* strongSwan netkey initialization and cleanup +/* strongSwan netkey initialization and cleanup * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security * * This program is free software; you can redistribute it and/or modify it diff --git a/src/starter/starter.c b/src/starter/starter.c index ff5ab9d87..0aab76d43 100644 --- a/src/starter/starter.c +++ b/src/starter/starter.c @@ -163,7 +163,7 @@ static void fsig(int signal) static void generate_selfcert() { struct stat stb; - + /* if ipsec.secrets file is missing then generate RSA default key pair */ if (stat(SECRETS_FILE, &stb) != 0) { @@ -176,7 +176,7 @@ static void generate_selfcert() { char buf[1024]; struct group group, *grp; - + if (getgrnam_r(IPSEC_GROUP, &group, buf, sizeof(buf), &grp) == 0 && grp) { gid = grp->gr_gid; @@ -187,7 +187,7 @@ static void generate_selfcert() { char buf[1024]; struct passwd passwd, *pwp; - + if (getpwnam_r(IPSEC_USER, &passwd, buf, sizeof(buf), &pwp) == 0 && pwp) { uid = pwp->pw_uid; @@ -360,7 +360,7 @@ int main (int argc, char **argv) plog("starter is already running (%s exists) -- no fork done", STARTER_PID_FILE); exit(LSB_RC_SUCCESS); } - + generate_selfcert(); /* fork if we're not debugging stuff */ @@ -381,7 +381,7 @@ int main (int argc, char **argv) dup2(fnull, STDERR_FILENO); close(fnull); } - setsid(); + setsid(); } break; case -1: @@ -491,7 +491,7 @@ int main (int argc, char **argv) _action_ |= FLAG_ACTION_LISTEN; } - if (!starter_cmp_pluto(cfg, new_cfg)) + if (!starter_cmp_pluto(cfg, new_cfg)) { plog("Pluto has changed"); if (starter_pluto_pid()) @@ -620,7 +620,7 @@ int main (int argc, char **argv) conn->state = STATE_TO_ADD; } } - + /* * Start charon */ diff --git a/src/starter/starterstroke.c b/src/starter/starterstroke.c index 96caff8cb..60da12bca 100644 --- a/src/starter/starterstroke.c +++ b/src/starter/starterstroke.c @@ -81,7 +81,7 @@ static int send_stroke_msg (stroke_msg_t *msg) ctl_addr.sun_family = AF_UNIX; strcpy(ctl_addr.sun_path, CHARON_CTL_FILE); - + /* starter is not called from commandline, and therefore absolutely silent */ msg->output_verbosity = -1; @@ -173,7 +173,7 @@ static void ip_address2string(ip_address *addr, char *buffer, size_t len) static void starter_stroke_add_end(stroke_msg_t *msg, stroke_end_t *msg_end, starter_end_t *conn_end) { char buffer[INET6_ADDRSTRLEN]; - + msg_end->auth = push_string(msg, conn_end->auth); msg_end->auth2 = push_string(msg, conn_end->auth2); msg_end->id = push_string(msg, conn_end->id); @@ -237,7 +237,7 @@ int starter_stroke_add_conn(starter_config_t *cfg, starter_conn_t *conn) msg.length = offsetof(stroke_msg_t, buffer); msg.add_conn.ikev2 = conn->keyexchange == KEY_EXCHANGE_IKEV2; msg.add_conn.name = push_string(&msg, connection_name(conn)); - + /* PUBKEY is preferred to PSK and EAP */ if (conn->policy & POLICY_PUBKEY) { @@ -254,7 +254,7 @@ int starter_stroke_add_conn(starter_config_t *cfg, starter_conn_t *conn) msg.add_conn.eap_type = conn->eap_type; msg.add_conn.eap_vendor = conn->eap_vendor; msg.add_conn.eap_identity = push_string(&msg, conn->eap_identity); - + if (conn->policy & POLICY_TUNNEL) { msg.add_conn.mode = MODE_TUNNEL; @@ -267,7 +267,7 @@ int starter_stroke_add_conn(starter_config_t *cfg, starter_conn_t *conn) { msg.add_conn.mode = MODE_TRANSPORT; msg.add_conn.proxy_mode = TRUE; - } + } else { msg.add_conn.mode = MODE_TRANSPORT; @@ -365,7 +365,7 @@ int starter_stroke_del_ca(starter_ca_t *ca) int starter_stroke_configure(starter_config_t *cfg) { stroke_msg_t msg; - + if (cfg->setup.cachecrls) { msg.type = STR_CONFIG; diff --git a/src/starter/starterwhack.c b/src/starter/starterwhack.c index 44b442ae2..b68096165 100644 --- a/src/starter/starterwhack.c +++ b/src/starter/starterwhack.c @@ -153,7 +153,7 @@ connection_name(starter_conn_t *conn) static void set_whack_end(whack_end_t *w, starter_end_t *end, sa_family_t family) -{ +{ if (end->srcip && end->srcip[0] != '%') { int len = 0; @@ -170,9 +170,9 @@ set_whack_end(whack_end_t *w, starter_end_t *end, sa_family_t family) } else { - anyaddr(AF_INET, &w->host_srcip); + anyaddr(AF_INET, &w->host_srcip); } - + w->id = end->id; w->cert = end->cert; w->ca = end->ca; |