Change in openvpn[master]: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
A message that is not in the archive (sent off-list or not yet received): gerrit.1737719138000.Iff12c4dbac84a814612aa8b5b89224be08bb9058@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
to review the following change.
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Rename occurences of 'struct link_socket' from 'ls' to 'sock'
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
---
M src/openvpn/init.c
M src/openvpn/init.h
M src/openvpn/mtcp.c
M src/openvpn/mtcp.h
M src/openvpn/mudp.c
M src/openvpn/mudp.h
M src/openvpn/multi.c
M src/openvpn/multi.h
8 files changed, 35 insertions(+), 35 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/74/874/1
src/openvpn/init.c +6 -6
@@ -4935,12 +4935,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4966,7 +4966,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4977,7 +4977,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -5004,11 +5004,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +7 -7
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); -if (mi && !proto_is_dgram (ls->info.proto)) + mi =multi_create_instance (m,NULL , sock); +if (mi && !proto_is_dgram (sock->info.proto)) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -139,10 +139,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -46,7 +46,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -186,14 +186,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -259,7 +259,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +9 -9
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -794,7 +794,7 @@ { goto err; } - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;generate_prefix (mi); }
@@ -3129,7 +3129,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3185,7 +3185,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3335,7 +3335,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3356,7 +3356,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3390,14 +3390,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -275,7 +275,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -290,7 +290,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -355,10 +355,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: flichtenheld, its_Giaan, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/874?usp=email )
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Patchset:
PS1:
I'm not a big fan of the ls to sock renaming, but since we did half of it earlier in the patch series, it is necessary to also do the rest to keep the code consistent. So here we go.
This is "mechanical renaming", so fine. The "merge conflict" bit seems to be gerrit being confused.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 24 Jan 2025 12:50:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v3 1/1 Rename occurences of 'struct link_socket' from 'ls' to 'sock'
In reply to a message not in the archiveFrom: Gianmarco De Gregori <[email protected]...>
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/874
This mail reflects revision 3 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/init.c +6 -6
@@ -4935,12 +4935,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4966,7 +4966,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4977,7 +4977,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -5004,11 +5004,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +7 -7
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); -if (mi && !proto_is_dgram (ls->info.proto)) + mi =multi_create_instance (m,NULL , sock); +if (mi && !proto_is_dgram (sock->info.proto)) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -139,10 +139,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -46,7 +46,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -186,14 +186,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -259,7 +259,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +9 -9
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -794,7 +794,7 @@ { goto err; } - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;generate_prefix (mi); }
@@ -3129,7 +3129,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3185,7 +3185,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3335,7 +3335,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3356,7 +3356,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3390,14 +3390,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -275,7 +275,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -290,7 +290,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -355,10 +355,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
Attention is currently required from: cron2, flichtenheld, its_Giaan, plaisthos.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Rename occurences of 'struct link_socket' from 'ls' to 'sock'
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
---
M src/openvpn/init.c
M src/openvpn/init.h
M src/openvpn/mtcp.c
M src/openvpn/mtcp.h
M src/openvpn/mudp.c
M src/openvpn/mudp.h
M src/openvpn/multi.c
M src/openvpn/multi.h
8 files changed, 33 insertions(+), 33 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/74/874/4
src/openvpn/init.c +6 -6
@@ -4921,12 +4921,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4952,7 +4952,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4963,7 +4963,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -4990,11 +4990,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +6 -6
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); + mi =multi_create_instance (m,NULL , sock);if (mi) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -140,10 +140,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -46,7 +46,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -186,14 +186,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -259,7 +259,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +8 -8
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -3128,7 +3128,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3184,7 +3184,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3334,7 +3334,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3355,7 +3355,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3389,14 +3389,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -275,7 +275,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -290,7 +290,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -355,10 +355,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 4
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld, its_Giaan, plaisthos.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/874?usp=email )
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 4
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 31 Jan 2025 10:58:51 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: flichtenheld, its_Giaan, plaisthos.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
to look at the new patch set (#5).
The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Rename occurences of 'struct link_socket' from 'ls' to 'sock'
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
---
M src/openvpn/init.c
M src/openvpn/init.h
M src/openvpn/mtcp.c
M src/openvpn/mtcp.h
M src/openvpn/mudp.c
M src/openvpn/mudp.h
M src/openvpn/multi.c
M src/openvpn/multi.h
8 files changed, 33 insertions(+), 33 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/74/874/5
src/openvpn/init.c +6 -6
@@ -4937,12 +4937,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4968,7 +4968,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4979,7 +4979,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -5006,11 +5006,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +6 -6
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); + mi =multi_create_instance (m,NULL , sock);if (mi) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -140,10 +140,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -44,7 +44,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -188,14 +188,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -261,7 +261,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +8 -8
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -3139,7 +3139,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3195,7 +3195,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3345,7 +3345,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3366,7 +3366,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3400,14 +3400,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -275,7 +275,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -290,7 +290,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -355,10 +355,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 5
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld, its_Giaan, plaisthos.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
to look at the new patch set (#7).
The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Rename occurences of 'struct link_socket' from 'ls' to 'sock'
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
---
M src/openvpn/init.c
M src/openvpn/init.h
M src/openvpn/mtcp.c
M src/openvpn/mtcp.h
M src/openvpn/mudp.c
M src/openvpn/mudp.h
M src/openvpn/multi.c
M src/openvpn/multi.h
8 files changed, 33 insertions(+), 33 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/74/874/7
src/openvpn/init.c +6 -6
@@ -4946,12 +4946,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4977,7 +4977,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4988,7 +4988,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -5015,11 +5015,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +6 -6
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); + mi =multi_create_instance (m,NULL , sock);if (mi) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -140,10 +140,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -44,7 +44,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -188,14 +188,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -261,7 +261,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +8 -8
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -3139,7 +3139,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3195,7 +3195,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3346,7 +3346,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3367,7 +3367,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3401,14 +3401,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -272,7 +272,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -287,7 +287,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -352,10 +352,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 7
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: its_Giaan <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
PATCH v7 1/1 Rename occurences of 'struct link_socket' from 'ls' to 'sock'
In reply to a message not in the archiveFrom: Gianmarco De Gregori <[email protected]...>
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/874
This mail reflects revision 7 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/init.c +6 -6
@@ -4946,12 +4946,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4977,7 +4977,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4988,7 +4988,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -5015,11 +5015,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +6 -6
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); + mi =multi_create_instance (m,NULL , sock);if (mi) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -140,10 +140,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -44,7 +44,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -188,14 +188,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -261,7 +261,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +8 -8
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -3139,7 +3139,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3195,7 +3195,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3346,7 +3346,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3367,7 +3367,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3401,14 +3401,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -272,7 +272,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -287,7 +287,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -352,10 +352,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
[Openvpn-devel] [PATCH applied] Re: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
This is really just straightforward renaming of the "remaining pieces" - some of these "link_socket" things have been touched by the multisocket patchset, and others not yet. I asked for the rest to be sent in a separate patch to untangle "straightforward renaming in unrelated code paths" from "actual multisocket related changes" - and, here we go.
Usually I link to the mail archives on mail-archive.com, but it's refusing cooperation today - so this is now linking to the sf.net archive for a change (+our gerrit). Hopefully the other site will recover...
Your patch has been applied to the master branch.
commit 7e5535289908af23bed244e7f0417358f2f316bc
Author: Gianmarco De Gregori Date: Thu Mar 6 11:13:39 2025 +0100
Rename occurences of 'struct link_socket' from 'ls' to 'sock'
Signed-off-by: Gianmarco De Gregori <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59156800/
URL: https://gerrit.openvpn.net/c/openvpn/+/874
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#8) to the change originally created by its_Giaan. ( http://gerrit.openvpn.net/c/openvpn/+/874?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Rename occurences of 'struct link_socket' from 'ls' to 'sock'
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59156800/
URL: https://gerrit.openvpn.net/c/openvpn/+/874
---
M src/openvpn/init.c
M src/openvpn/init.h
M src/openvpn/mtcp.c
M src/openvpn/mtcp.h
M src/openvpn/mudp.c
M src/openvpn/mudp.h
M src/openvpn/multi.c
M src/openvpn/multi.h
8 files changed, 33 insertions(+), 33 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/74/874/8
src/openvpn/init.c +6 -6
@@ -4946,12 +4946,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4977,7 +4977,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4988,7 +4988,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -5015,11 +5015,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +6 -6
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); + mi =multi_create_instance (m,NULL , sock);if (mi) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -140,10 +140,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -44,7 +44,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -188,14 +188,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -261,7 +261,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +8 -8
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -3139,7 +3139,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3195,7 +3195,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3346,7 +3346,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3367,7 +3367,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3401,14 +3401,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -272,7 +272,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -287,7 +287,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -352,10 +352,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 8
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/874?usp=email )
Change subject: Rename occurences of 'struct link_socket' from 'ls' to 'sock'
......................................................................
Rename occurences of 'struct link_socket' from 'ls' to 'sock'
This commit renames all instances of 'struct link_socket' from the abbreviation 'ls' to the more descriptive 'sock' making it clearer that the variables represent socket-related structures.
No functional changes have been introduced.
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59156800/
URL: https://gerrit.openvpn.net/c/openvpn/+/874
---
M src/openvpn/init.c
M src/openvpn/init.h
M src/openvpn/mtcp.c
M src/openvpn/mtcp.h
M src/openvpn/mudp.c
M src/openvpn/mudp.h
M src/openvpn/multi.c
M src/openvpn/multi.h
8 files changed, 33 insertions(+), 33 deletions(-)
src/openvpn/init.c +6 -6
@@ -4946,12 +4946,12 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls) +struct link_socket *sock) {CLEAR (*dest);/* proto_is_dgram will ASSERT(0) if proto is invalid */ - dest->mode =proto_is_dgram (ls->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; + dest->mode =proto_is_dgram (sock->info.proto) ?CM_CHILD_UDP :CM_CHILD_TCP ; dest->gc =gc_new ();
@@ -4977,7 +4977,7 @@/* options */ dest->options = src->options; - dest->options.ce.proto = ls->info.proto; + dest->options.ce.proto = sock->info.proto;options_detach (&dest->options); dest->c2.event_set = src->c2.event_set;
@@ -4988,7 +4988,7 @@* The CM_TOP context does the socket listen(), * and the CM_CHILD_TCP context does the accept(). */ - dest->c2.accept_from = ls; + dest->c2.accept_from = sock; }#ifdef ENABLE_PLUGIN
@@ -5015,11 +5015,11 @@ ALLOC_ARRAY_GC(dest->c2.link_sockets, struct link_socket *, 1, &dest->gc);/* inherit parent link_socket and tuntap */ - dest->c2.link_sockets[0 ] = ls; + dest->c2.link_sockets[0 ] = sock; ALLOC_ARRAY_GC(dest->c2.link_socket_infos, struct link_socket_info *, 1, &dest->gc); ALLOC_OBJ_GC(dest->c2.link_socket_infos[0], struct link_socket_info, &dest->gc); - *dest->c2.link_socket_infos[0 ] = ls->info; + *dest->c2.link_socket_infos[0 ] = sock->info;/* locally override some link_socket_info fields */ dest->c2.link_socket_infos[0 ]->lsa = &dest->c1.link_socket_addrs[0 ];
src/openvpn/init.h +1 -1
@@ -96,7 +96,7 @@void inherit_context_child (struct context *dest,const struct context *src, -struct link_socket *ls); +struct link_socket *sock);void inherit_context_top (struct context *dest,const struct context *src);
src/openvpn/mtcp.c +6 -6
@@ -47,16 +47,16 @@ };struct multi_instance * -multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls) +multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - mi =multi_create_instance (m,NULL , ls); + mi =multi_create_instance (m,NULL , sock);if (mi) { - mi->real.proto = ls->info.proto; + mi->real.proto = sock->info.proto;struct hash_element *he;const uint32_t hv =hash_value (hash, &mi->real);struct hash_bucket *bucket =hash_bucket (hash, hv);
@@ -140,10 +140,10 @@void multi_tcp_dereference_instance (struct multi_io *multi_io,struct multi_instance *mi) { -struct link_socket *ls = mi->context.c2.link_sockets[0 ]; -if (ls && mi->socket_set_called) +struct link_socket *sock = mi->context.c2.link_sockets[0 ]; +if (sock && mi->socket_set_called) { -event_del (multi_io->es,socket_event_handle (ls)); +event_del (multi_io->es,socket_event_handle (sock)); mi->socket_set_called = false; } multi_io->n_esr =0 ;
src/openvpn/mtcp.h +1 -1
@@ -44,7 +44,7 @@bool multi_tcp_process_outgoing_link_ready (struct multi_context *m,struct multi_instance *mi,const unsigned int mpp_flags); -struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *ls); +struct multi_instance *multi_create_instance_tcp (struct multi_context *m,struct link_socket *sock);void multi_tcp_link_out_deferred (struct multi_context *m,struct multi_instance *mi);
src/openvpn/mudp.c +4 -4
@@ -188,14 +188,14 @@struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct mroute_addr real = {0 };struct multi_instance *mi =NULL ;struct hash *hash = m->hash; - real.proto = ls->info.proto; - m->hmac_reply_ls = ls; + real.proto = sock->info.proto; + m->hmac_reply_ls = sock;if (mroute_extract_openvpn_sockaddr (&real, &m->top.c2.from.dest, true) && m->top.c2.buf.len >0 )
@@ -261,7 +261,7 @@* connect-freq but not against connect-freq-initial */ reflect_filter_rate_limit_decrease (m->initial_rate_limiter); - mi =multi_create_instance (m, &real, ls); + mi =multi_create_instance (m, &real, sock);if (mi) {hash_add_fast (hash, bucket, &mi->real, hv, mi);
src/openvpn/mudp.h +3 -3
@@ -33,7 +33,7 @@unsigned int p2mp_iow_flags (const struct multi_context *m); -void multi_process_io_udp (struct multi_context *m,struct link_socket *ls); +void multi_process_io_udp (struct multi_context *m,struct link_socket *sock);/**************************************************************************/ /** * Get, and if necessary create, the multi_instance associated with a
@@ -47,13 +47,13 @@* successful, returns the newly created instance. * * @param m - The single multi_context structure. -* @param ls - Listening socket where this instance is connecting to +* @param sock - Listening socket where this instance is connecting to * * @return A pointer to a multi_instance if one already existed for the * packet's source address or if one was a newly created successfully. * NULL if one did not yet exist and a new one was not created. */ struct multi_instance *multi_get_create_instance_udp (struct multi_context *m,bool *floated, -struct link_socket *ls); +struct link_socket *sock);#endif /* ifndef MUDP_H */
src/openvpn/multi.c +8 -8
@@ -751,7 +751,7 @@*/ struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls) +struct link_socket *sock) {struct gc_arena gc =gc_new ();struct multi_instance *mi;
@@ -774,7 +774,7 @@generate_prefix (mi); } -inherit_context_child (&mi->context, &m->top, ls); +inherit_context_child (&mi->context, &m->top, sock);if (IS_SIG (&mi->context)) { goto err;
@@ -3139,7 +3139,7 @@void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls) +struct link_socket *sock) {struct mroute_addr real = {0 };struct hash *hash = m->hash;
@@ -3195,7 +3195,7 @@ mi->context.c2.to_link_addr = &mi->context.c2.from;/* inherit parent link_socket and link_socket_info */ - mi->context.c2.link_sockets[0 ] = ls; + mi->context.c2.link_sockets[0 ] = sock; mi->context.c2.link_socket_infos[0 ]->lsa->actual = m->top.c2.from;tls_update_remote_addr (mi->context.c2.tls_multi, &mi->context.c2.from);
@@ -3346,7 +3346,7 @@*/ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance, -const unsigned int mpp_flags,struct link_socket *ls) +const unsigned int mpp_flags,struct link_socket *sock) {struct gc_arena gc =gc_new ();
@@ -3367,7 +3367,7 @@#ifdef MULTI_DEBUG_EVENT_LOOP printf ("TCP/UDP -> TUN [%d]\n" ,BLEN (&m->top.c2.buf));#endif -multi_set_pending (m,multi_get_create_instance_udp (m, &floated, ls)); +multi_set_pending (m,multi_get_create_instance_udp (m, &floated, sock)); }else {
@@ -3401,14 +3401,14 @@/* decrypt in instance context */ perf_push (PERF_PROC_IN_LINK ); - lsi = &ls->info; + lsi = &sock->info; orig_buf = c->c2.buf.data;if (process_incoming_link_part1 (c, lsi, floated)) {/* nonzero length means that we have a valid, decrypted packed */ if (floated && c->c2.buf.len >0 ) { -multi_process_float (m, m->pending, ls); +multi_process_float (m, m->pending, sock); }process_incoming_link_part2 (c, lsi, orig_buf);
src/openvpn/multi.h +4 -4
@@ -272,7 +272,7 @@void multi_top_free (struct multi_context *m);struct multi_instance *multi_create_instance (struct multi_context *m,const struct mroute_addr *real, -struct link_socket *ls); +struct link_socket *sock);void multi_close_instance (struct multi_context *m,struct multi_instance *mi,bool shutdown);
@@ -287,7 +287,7 @@* updates hashtables in multi_context. */ void multi_process_float (struct multi_context *m,struct multi_instance *mi, -struct link_socket *ls); +struct link_socket *sock);#define MPP_PRE_SELECT (1<<0)#define MPP_CONDITIONAL_PRE_SELECT (1<<1)
@@ -352,10 +352,10 @@* when using TCP transport. Otherwise NULL, as is * the case when using UDP transport. * @param mpp_flags - Fast I/O optimization flags. -* @param ls - Socket where the packet was received. +* @param sock - Socket where the packet was received. */ bool multi_process_incoming_link (struct multi_context *m,struct multi_instance *instance,const unsigned int mpp_flags, -struct link_socket *ls); +struct link_socket *sock);/**
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/874?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058
Gerrit-Change-Number: 874
Gerrit-PatchSet: 8
Gerrit-Owner: its_Giaan <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged