Commit e51d9a73 authored by Frank Lichtenheld's avatar Frank Lichtenheld Committed by Gert Doering
Browse files

Reformat for sp_after_comma=add



It is our usual style.
Signed-off-by: Frank Lichtenheld's avatarFrank Lichtenheld <frank@lichtenheld.com>
Acked-by: Antonio's avatarAntonio Quartulli <a@unstable.cc>
Message-Id: <20220519085428.6783-2-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24399.html

Signed-off-by: default avatarGert Doering <gert@greenie.muc.de>
parent c9624969
......@@ -210,7 +210,7 @@ write_cc_options_file(const char *name, const char **envp)
return OPENVPN_PLUGIN_FUNC_SUCCESS;
}
FILE *fp = fopen(name,"w");
FILE *fp = fopen(name, "w");
if (!fp)
{
plugin_log(PLOG_ERR, MODULE, "fopen('%s') failed", name);
......
......@@ -105,7 +105,7 @@ openvpn_plugin_open_v3(const int version,
plugin->mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_TLS_FINAL);
plugin->mask |= OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_TLS_VERIFY);
ovpn_note("vpn endpoint type=%s",plugin->type == CLIENT ? "client" : "server");
ovpn_note("vpn endpoint type=%s", plugin->type == CLIENT ? "client" : "server");
rv->type_mask = plugin->mask;
rv->handle = (void *)plugin;
......
......@@ -25,11 +25,11 @@
VERSIONHELPERAPI
IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack)
{
OSVERSIONINFOEXW vi = {sizeof(vi),major,minor,0,0,{0},servpack};
OSVERSIONINFOEXW vi = {sizeof(vi), major, minor, 0, 0, {0}, servpack};
return VerifyVersionInfoW(&vi, VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
VER_MAJORVERSION,VER_GREATER_EQUAL),
VER_MINORVERSION,VER_GREATER_EQUAL),
VER_MAJORVERSION, VER_GREATER_EQUAL),
VER_MINORVERSION, VER_GREATER_EQUAL),
VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL));
}
......@@ -108,7 +108,7 @@ IsWindows10OrGreater()
VERSIONHELPERAPI
IsWindowsServer(void)
{
OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION};
OSVERSIONINFOEXW vi = {sizeof(vi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION};
return !VerifyVersionInfoW(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL));
}
......
......@@ -273,7 +273,7 @@ buf_puts(struct buffer *buf, const char *str)
int cap = buf_forward_capacity(buf);
if (cap > 0)
{
strncpynt((char *)ptr,str, cap);
strncpynt((char *)ptr, str, cap);
*(buf->data + buf->capacity - 1) = 0; /* windows vsnprintf needs this */
buf->len += (int) strlen((char *)ptr);
ret = true;
......
......@@ -280,12 +280,12 @@ lz4v2_decompress(struct buffer *buf, struct buffer work,
c = head[1];
if (c == COMP_ALGV2_LZ4_BYTE) /* packet was compressed */
{
buf_advance(buf,2);
buf_advance(buf, 2);
do_lz4_decompress(zlen_max, &work, buf, compctx);
}
else if (c == COMP_ALGV2_UNCOMPRESSED_BYTE)
{
buf_advance(buf,2);
buf_advance(buf, 2);
}
else
{
......
......@@ -1033,7 +1033,7 @@ tls1_P_hash(const mbedtls_md_info_t *md_kt, const uint8_t *sec, int sec_len,
ASSERT(0 == mbedtls_md_setup(ctx_tmp, md_kt, 1));
ASSERT(0 == mbedtls_md_hmac_starts(ctx_tmp, sec, sec_len));
hmac_ctx_update(ctx,seed,seed_len);
hmac_ctx_update(ctx, seed, seed_len);
hmac_ctx_final(ctx, A1);
for (;; )
......
......@@ -352,7 +352,7 @@ ecdsa_sign(int type, const unsigned char *dgst, int dgstlen, unsigned char *sig,
if (len > ECDSA_size(ec))
{
ECDSA_SIG_free(s);
msg(M_NONFATAL,"Error in cryptoapicert: DER encoded ECDSA signature is too long (%d bytes)", len);
msg(M_NONFATAL, "Error in cryptoapicert: DER encoded ECDSA signature is too long (%d bytes)", len);
return 0;
}
*siglen = i2d_ECDSA_SIG(s, &sig);
......
......@@ -572,7 +572,7 @@ list_test(void)
* --------------------------------------------------------------------
*/
#define mix(a,b,c) \
#define mix(a, b, c) \
{ \
a -= b; a -= c; a ^= (c>>13); \
b -= c; b -= a; b ^= (a<<8); \
......
......@@ -2119,7 +2119,7 @@ management_android_control(struct management *man, const char *command, const ch
CLEAR(up);
strncpy(up.username, msg, sizeof(up.username)-1);
management_query_user_pass(management, &up, command, GET_USER_PASS_NEED_OK,(void *) 0);
management_query_user_pass(management, &up, command, GET_USER_PASS_NEED_OK, (void *) 0);
return strcmp("ok", up.password)==0;
}
......@@ -2134,9 +2134,9 @@ managment_android_persisttun_action(struct management *man)
{
struct user_pass up;
CLEAR(up);
strcpy(up.username,"tunmethod");
strcpy(up.username, "tunmethod");
management_query_user_pass(management, &up, "PERSIST_TUN_ACTION",
GET_USER_PASS_NEED_OK,(void *) 0);
GET_USER_PASS_NEED_OK, (void *) 0);
if (!strcmp("NOACTION", up.password))
{
return ANDROID_KEEP_OLD_TUN;
......@@ -2266,7 +2266,7 @@ man_write(struct management *man)
#ifdef TARGET_ANDROID
if (man->connection.fdtosend > 0)
{
sent = man_send_with_fd(man->connection.sd_cli, BPTR(buf), len, MSG_NOSIGNAL,man->connection.fdtosend);
sent = man_send_with_fd(man->connection.sd_cli, BPTR(buf), len, MSG_NOSIGNAL, man->connection.fdtosend);
man->connection.fdtosend = -1;
}
else
......
......@@ -349,7 +349,7 @@ format_extended_socket_error(int fd, int *mtu, struct gc_arena *gc)
}
else
{
buf_printf(&out,"CMSG=%d|", cmsg->cmsg_type);
buf_printf(&out, "CMSG=%d|", cmsg->cmsg_type);
}
}
else if (cmsg->cmsg_level == IPPROTO_IPV6)
......@@ -360,7 +360,7 @@ format_extended_socket_error(int fd, int *mtu, struct gc_arena *gc)
}
else
{
buf_printf(&out,"CMSG=%d|", cmsg->cmsg_type);
buf_printf(&out, "CMSG=%d|", cmsg->cmsg_type);
}
}
}
......
......@@ -1034,7 +1034,7 @@ net_addr_v4_add(openvpn_net_ctx_t *ctx, const char *iface,
addr_v4.ipv4 = htonl(*addr);
msg(M_INFO, "%s: %s/%d dev %s", __func__,
inet_ntop(AF_INET, &addr_v4.ipv4, buf, sizeof(buf)), prefixlen,iface);
inet_ntop(AF_INET, &addr_v4.ipv4, buf, sizeof(buf)), prefixlen, iface);
return sitnl_addr_add(AF_INET, iface, &addr_v4, prefixlen);
}
......
......@@ -1819,7 +1819,7 @@ show_settings(const struct options *o)
#ifdef ENABLE_MANAGEMENT
if ((o->management_flags & MF_EXTERNAL_CERT))
{
SHOW_PARM("cert_file","EXTERNAL_CERT","%s");
SHOW_PARM("cert_file", "EXTERNAL_CERT", "%s");
}
else
#endif
......@@ -1829,7 +1829,7 @@ show_settings(const struct options *o)
#ifdef ENABLE_MANAGEMENT
if ((o->management_flags & MF_EXTERNAL_KEY))
{
SHOW_PARM("priv_key_file","EXTERNAL_PRIVATE_KEY","%s");
SHOW_PARM("priv_key_file", "EXTERNAL_PRIVATE_KEY", "%s");
}
else
#endif
......@@ -4349,7 +4349,7 @@ options_string_version(const char *s, struct gc_arena *gc)
}
char *
options_string_extract_option(const char *options_string,const char *opt_name,
options_string_extract_option(const char *options_string, const char *opt_name,
struct gc_arena *gc)
{
char *ret = NULL;
......@@ -7100,7 +7100,7 @@ add_option(struct options *options,
{
VERIFY_PERMISSION(OPT_P_INSTANCE);
msg(D_PUSH, "PUSH_REMOVE '%s'", p[1]);
push_remove_option(options,p[1]);
push_remove_option(options, p[1]);
}
else if (streq(p[0], "ifconfig-pool") && p[1] && p[2] && !p[4])
{
......
......@@ -193,7 +193,7 @@ xkey_pkcs11h_sign(void *handle, unsigned char *sig,
{
msg(D_XKEY, "xkey_pkcs11h_sign: signing with RSA key: padmode = %s",
sigalg.padmode);
if (!strcmp(sigalg.padmode,"none"))
if (!strcmp(sigalg.padmode, "none"))
{
mech.mechanism = CKM_RSA_X_509;
}
......
......@@ -722,7 +722,7 @@ ifconfig_pool_read(struct ifconfig_pool_persist *persist, struct ifconfig_pool *
*/
if (h >= 0)
{
msg(M_INFO, "succeeded -> ifconfig_pool_set(hand=%d)",h);
msg(M_INFO, "succeeded -> ifconfig_pool_set(hand=%d)", h);
ifconfig_pool_set(pool, cn_buf, h, persist->fixed);
}
}
......
......@@ -432,7 +432,7 @@ proxy_entry_new(struct proxy_connection **list,
msg(M_WARN|M_ERRNO, "PORT SHARE PROXY: cannot create socket");
return false;
}
status = openvpn_connect(sd_server,(const struct sockaddr *) &server_addr, 5, NULL);
status = openvpn_connect(sd_server, (const struct sockaddr *) &server_addr, 5, NULL);
if (status)
{
msg(M_WARN, "PORT SHARE PROXY: connect to port-share server failed");
......
......@@ -3440,7 +3440,7 @@ struct rtmsg {
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
#endif
#define max(a,b) ((a) > (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
void
get_default_gateway(struct route_gateway_info *rgi, openvpn_net_ctx_t *ctx)
......
......@@ -252,7 +252,7 @@ openvpn_popen(const struct argv *a, const struct env_set *es)
if (pid == (pid_t)0) /* child side */
{
close(pipe_stdout[0]); /* Close read end */
dup2(pipe_stdout[1],1);
dup2(pipe_stdout[1], 1);
execve(cmd, argv, envp);
exit(OPENVPN_EXECVE_FAILURE);
}
......
......@@ -525,7 +525,7 @@ openvpn_getaddrinfo(unsigned int flags,
if (!(flags & GETADDR_RESOLVE) || status == EAI_FAIL)
{
msg(msglevel, "RESOLVE: Cannot parse IP address: %s:%s (%s)",
print_hostname,print_servname, gai_strerror(status));
print_hostname, print_servname, gai_strerror(status));
goto done;
}
......@@ -1978,7 +1978,7 @@ linksock_print_addr(struct link_socket *sock)
ASSERT(cur);
msg(msglevel, "%s link local (bound): %s",
proto2ascii(sock->info.proto, sock->info.af, true),
print_sockaddr(cur->ai_addr,&gc));
print_sockaddr(cur->ai_addr, &gc));
}
else
{
......@@ -2374,12 +2374,12 @@ link_socket_bad_incoming_addr(struct buffer *buf,
"TCP/UDP: Incoming packet rejected from %s[%d], expected peer address: %s (allow this incoming source address/port by removing --remote or adding --float)",
print_link_socket_actual(from_addr, &gc),
(int)from_addr->dest.addr.sa.sa_family,
print_sockaddr_ex(info->lsa->remote_list->ai_addr,":",PS_SHOW_PORT, &gc));
print_sockaddr_ex(info->lsa->remote_list->ai_addr, ":", PS_SHOW_PORT, &gc));
/* print additional remote addresses */
for (ai = info->lsa->remote_list->ai_next; ai; ai = ai->ai_next)
{
msg(D_LINK_ERRORS,"or from peer address: %s",
print_sockaddr_ex(ai->ai_addr,":",PS_SHOW_PORT, &gc));
msg(D_LINK_ERRORS, "or from peer address: %s",
print_sockaddr_ex(ai->ai_addr, ":", PS_SHOW_PORT, &gc));
}
break;
}
......@@ -2730,7 +2730,7 @@ print_sockaddr_ex(const struct sockaddr *sa,
if (status!=0)
{
buf_printf(&out,"[nameinfo() err: %s]",gai_strerror(status));
buf_printf(&out, "[nameinfo() err: %s]", gai_strerror(status));
return BSTR(&out);
}
......
......@@ -873,7 +873,7 @@ addr_inet4or6(struct sockaddr *addr)
return addr->sa_family == AF_INET || addr->sa_family == AF_INET6;
}
int addr_guess_family(sa_family_t af,const char *name);
int addr_guess_family(sa_family_t af, const char *name);
static inline int
af_addr_size(sa_family_t af)
......
......@@ -221,7 +221,7 @@ const char *
tls_peer_ncp_list(const char *peer_info, struct gc_arena *gc)
{
/* Check if the peer sends the IV_CIPHERS list */
const char *iv_ciphers = extract_var_peer_info(peer_info,"IV_CIPHERS=", gc);
const char *iv_ciphers = extract_var_peer_info(peer_info, "IV_CIPHERS=", gc);
if (iv_ciphers)
{
return iv_ciphers;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment