From patchwork Fri Jan 24 11:45:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "ordex (Code Review)" X-Patchwork-Id: 4073 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:c127:b0:5e7:b9eb:58e8 with SMTP id jm39csp762076mab; Fri, 24 Jan 2025 03:46:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU4lc0Fj6sOo2VBws/Y1jh5/6dhApmFGhjEk7z3p7kKiirVU0L8uxk7XKdZHQ+OMP8Wpm4NzfS/R6E=@openvpn.net X-Google-Smtp-Source: AGHT+IEpavI+dMgeKx+wRFsebD/1jiVuQaFUV+PTyhMuqGwDK3kObmlOKndC3OdEsxajsP1HL9An X-Received: by 2002:a05:6808:2f11:b0:3f1:b10f:8f67 with SMTP id 5614622812f47-3f1b10f9363mr15720540b6e.7.1737719169211; Fri, 24 Jan 2025 03:46:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737719169; cv=none; d=google.com; s=arc-20240605; b=LDB25IPEAoRHtayGuoFrWHQGhGmfks7RI5ysscsnizfKO4wjfgr3dzQBsm+eS4Gjn/ rNdVHAgowtC3aTB5VY40JHdXMmWcqmi44Gr0dJe2KVyiAw9cXFhnxStdxWWr1BFjU5tj CCSqWwqya+B7yVc5eYIfQLPji+YaEINJakdDXUh2lgdzFQ4znylJPeSBrvRjiXclzXDn /RKlZpjqlpe/ZIAt9od8N+CY4C7VJ6JQ+ukW3iAE6e6vek0ucGcQPJuHt6pThJgeduiJ Unn7WcF48f8q0IgT6DGg27yjCha3NzoUB3nynSD9UycdI3eFezRh9Hk33rAw4j1apmgx 9XoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=ESiWRaiu+Zb6E9ehQinXLiBSofbiuuL5am+qZ+xL1RU=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=HVX7LYb9Zm1cTlUwujWcPXQo6ez/8WIJdz6JublSH3qUBAMZUndKqcykRQ6MX4GHtI Nz9w83kOjlcu4CEoi1VpOfP7MH+IIR3zf7+unu8y+/PMttqTW0RGVISNF86V27qMDpI3 9RBnixMYG2ullbqWkdXPf+BQEJHNL07QhSg77U05LpD8MlDEVLcMIyXEAEbDHGBK9R2U PXtaAvZ+/iJC+CsyqV0w2IXOch8s9xml0OM0zCKgQ0rGAsgHyGwJezb22Ad7lUCFxEEm QTzuY5wIKjT0aun3bf8W//oXpk4ZqIhjQ5BIYEKSk7jGluDzM79Fs908PgnWgxNmVPZh 5R1Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QTaiBVEL; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=VcVI3byP; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NVxv9al0; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5614622812f47-3f1f084fd99si1429074b6e.21.2025.01.24.03.46.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2025 03:46:09 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QTaiBVEL; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=VcVI3byP; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NVxv9al0; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tbI8S-00032f-F3; Fri, 24 Jan 2025 11:46:04 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tbI8R-00032X-1y for openvpn-devel@lists.sourceforge.net; Fri, 24 Jan 2025 11:46:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=B8YJi7cLl1BpnaDjcJu2zEounLsTQjFUz+y4qrhWWSw=; b=QTaiBVEL8Kgp2B00Uiabm9MbOc W9cdFJr66Wd5qSk4j5t27qJN98TiUVKajxXZn58xUXtw84boc1InXtWfG2Zvk5yUM7BZ9xn7APuO4 ef2xfruDrylNkg/oRNIsk0QVmYB4fFmDtCIW8nJYX3qB1O7eJQiLVyBr2krCxTGcKDWI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=B8YJi7cLl1BpnaDjcJu2zEounLsTQjFUz+y4qrhWWSw=; b=V cVI3byPNomaL0kTQ2kwIw2ARWwKjHbYIxoZltynxwoiVqCqYJX7hu9dajuGxM0IPkUtiCklG0slwG W6ZpwAgz1psb3InGjecTvImGxgkt/8u4FBYfgRbvsOvHVsWcGmIqLrJ7kDx/pdmifr83x7YrB6ca/ I316+7aBdTvrrnuM=; Received: from mail-wm1-f43.google.com ([209.85.128.43]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tbI8P-0002Dl-4M for openvpn-devel@lists.sourceforge.net; Fri, 24 Jan 2025 11:46:02 +0000 Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-43690d4605dso13383725e9.0 for ; Fri, 24 Jan 2025 03:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1737719154; x=1738323954; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=B8YJi7cLl1BpnaDjcJu2zEounLsTQjFUz+y4qrhWWSw=; b=NVxv9al0VN1jRFJTKIcBG6PNEORDakCoKCl8+VkW90UubnX0ShwKNUxkj53GyMSp8X eLh0mgWO/8hKp8lVfdmBkpAeCFsVjgBK7W6Jv0Y7WtjMBkirL8Ta8Uq1pQpI0nHMqh6L Lu+MGfXEE408Ir99U3Cwig6Tn2N9ZRd0BL1Pd5jduCnVl8hX4FXY0neaH67pGQimhHsk WOcfxm3pNUYgFxErCBdmq9TtDXK/gXy6l4MpIB2dsI+ejQcxNOl2Y/wa8m0OcCAzCEYb J+xEg3Hxto9nhP5tU/NXQtyovgPUpKW1p06V9nt9JuHF9cz1hFCazxBvBvqC0tXJCnAQ Y+1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737719154; x=1738323954; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B8YJi7cLl1BpnaDjcJu2zEounLsTQjFUz+y4qrhWWSw=; b=up6x0h0eUEMCDPWJK/eKF6bJ6atEmMTnQBIVXarMiOnc2B9M5I9YnWxLY11U5sod0l oxg9vRTDpJdl0eEl6VNptALEYllJivHi71YthCq6jKHu0owJShzd+pNv2KM5v5Ht2sqX ApgedHsmlb8SagDMeyiK3533frnFW9uesssNPYvuX3FjFZaps1xzgiLD+p7l2I8DwIqQ 62eBvX96pzXmPu/rT/RwW0gaKxxZRi2o9a7+CPQyulRdR9SmMJWZnwTZbSwOK5nh+14D PuZhurrKKtj+Wx3KRZbuv2N1WDu62CTch+FP7nMK004Wd6+HW2nSkVv+nH6fyhpWSl3F 845Q== X-Gm-Message-State: AOJu0Yx/t5LVMwuvVqMEnQ0tug+JigfyiNVOTTYo57onaEq0hjk++K1V Jsn09uBQv4MIDkFWAN0xREOpx9upTtHqO5QWxOTc10f8IVK1TU+8lYtQ/ixalB4= X-Gm-Gg: ASbGncvhoKAhy/ythq3IIyBb5NykN3DMQPclW/0qK3zokDOmUAWi4C077wj1GBEx5x9 7l109DlNizGnU+vabQaJgRDZ1/FS0L1vTJTupt4hp1FK3A2JGd6dxkc9YDasYwU+EzZ9WptwlSs f5md3GrOAmXmhlgdhwhmW4TO5FKAnv79N+PqtpOxRpvGMOLPyy/ImK0KZ0m8OKcaMPxfwiUeL+r jwbJ5qrOrmYRZ6v0g6ARpABG4kuIHKi8Fr71LGx6+bCjotpXoK8wpXEbLZodlsyr1GQ/Xbg6NpT kpqgBsi1rj7Fujw9DWNPhNdxb9oXxummr/uc3LqKQZnwm7xpOXuknYXU64IoOt1ZH5BJz52A X-Received: by 2002:a05:600c:1e0b:b0:434:ea21:e14f with SMTP id 5b1f17b1804b1-438913ed04amr270986005e9.13.1737719154458; Fri, 24 Jan 2025 03:45:54 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd54bfb0sm22872445e9.32.2025.01.24.03.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 03:45:54 -0800 (PST) From: "its_Giaan (Code Review)" X-Google-Original-From: "its_Giaan (Code Review)" X-Gerrit-PatchSet: 1 Date: Fri, 24 Jan 2025 11:45:53 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058 X-Gerrit-Change-Number: 874 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: d0e4f83d30b7a0f0c296ff2ad8dc54dc8b49d4b7 References: Message-ID: <05611c9b453f796e7b71feb86f8a69684c474d2e-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.128.43 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.128.43 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.43 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.43 listed in wl.mailspike.net] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tbI8P-0002Dl-4M Subject: [Openvpn-devel] [M] Change in openvpn[master]: Rename occurences of 'struct link_socket' from 'ls' to 'sock' X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: gianmarco@mandelbit.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1822130615391755589?= X-GMAIL-MSGID: =?utf-8?q?1822130615391755589?= X-getmail-filter-classifier: gerrit message type newchange 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. Change-Id: Iff12c4dbac84a814612aa8b5b89224be08bb9058 Signed-off-by: Gianmarco De Gregori --- 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 diff --git a/src/openvpn/init.c b/src/openvpn/init.c index d84f826..2ae3726 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -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]; diff --git a/src/openvpn/init.h b/src/openvpn/init.h index 11c32ac..50b38e3 100644 --- a/src/openvpn/init.h +++ b/src/openvpn/init.h @@ -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); diff --git a/src/openvpn/mtcp.c b/src/openvpn/mtcp.c index 582e9b3..38dd9f0 100644 --- a/src/openvpn/mtcp.c +++ b/src/openvpn/mtcp.c @@ -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; diff --git a/src/openvpn/mtcp.h b/src/openvpn/mtcp.h index 0a5b045..a0ef6a4 100644 --- a/src/openvpn/mtcp.h +++ b/src/openvpn/mtcp.h @@ -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); diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index 86e1713..8496400 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -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); diff --git a/src/openvpn/mudp.h b/src/openvpn/mudp.h index 357b684..37752e1 100644 --- a/src/openvpn/mudp.h +++ b/src/openvpn/mudp.h @@ -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 */ diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 809fde5..ee8a599 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -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); diff --git a/src/openvpn/multi.h b/src/openvpn/multi.h index 092aed6..229f500 100644 --- a/src/openvpn/multi.h +++ b/src/openvpn/multi.h @@ -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); /**