From patchwork Mon Sep 16 13:04:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "ralf_lici (Code Review)" X-Patchwork-Id: 3831 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:c41d:b0:5b9:581e:f939 with SMTP id jt29csp1191556mab; Mon, 16 Sep 2024 06:04:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVaYGpe6FRzt5OgqvoIP2+57dDoeXmuuYuFPHI0fh3FG0cipbH6zUno3sfJ0TqWFEgMhFhYoYMjkE=@openvpn.net X-Google-Smtp-Source: AGHT+IGJ9cvjaZZfiTf/PKXq47OAG9PH9uCXRVJIMnkMuCjHMI33CkFAzBx0LAZyPcs7v3VsSz/M X-Received: by 2002:a05:6e02:4a8:b0:3a0:8c77:345 with SMTP id e9e14a558f8ab-3a08c7704bdmr70388725ab.6.1726491868929; Mon, 16 Sep 2024 06:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726491868; cv=none; d=google.com; s=arc-20240605; b=jh6j3BXhqkwUhKWMTy9JtEHY0gx3ZoHen1MkJ8jCsWdJvjBTqn7kpnTLk9w86Sxm5d 7QJh2f1w9xF0guplGSseEgwKanEH026zNdh2j+REvN9xRKvbe4zgL1bwZSqHsq2HNtg5 9starafnG63ZqgPn5N2+xMPsEv/gpkqHs4wrl4Lx351q7Czl3ccAe4ZuB6/wWR8D5oId YJKSOHzwtFDeYh05LsB7CUf5rX1ZXCr/1mV6owdewj8JJu1IYfOR0m/baLD4PtPOGTFM ZryfmipG+rOIR31OZMiOVTc6ReqVIqs642yVOxRW44SDpZLg6165LSubw0lCVmwKRaI7 oNQQ== 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=CIFfppSZ23GXjrsHxhxNa3C4Usdlv+s+QMavFA8ZoW0=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=Py7/0No2TqKZYx6ultisE3J9zkUJEU2xPc0hhbr0+6LEhO9x8L9ZB3mtA/CVtBFOke Iyck4dvthD5cyRJl3RqOw7Z0ZPcd3YZiB/JuBaAYdROSrky0Squ4Ebu//iDQ8fSYv/2R mowdzYQmJujZELlsC7GRluURuo8b+imzv2+6jepb+05xfHOt2PE/4ar9ctn16ajOOPZn 0/cRHC4eiWrJVuqvtQQWMErF3kxqNN4P6T5vGwVcAHxIS+79uFF5S2iqN9nkrRKpegSl Fign2nj8RD2DIVqPb2CP55xm8DGZM7eyZCzUQlIAyVR2ysy5xuTerEsrPD5BuCfIYaqF LDng==; 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=aSirWX6u; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=gd977y59; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=C4YG0Ib2; 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 e9e14a558f8ab-3a092e9de95si22202665ab.194.2024.09.16.06.04.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Sep 2024 06:04:28 -0700 (PDT) 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=aSirWX6u; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=gd977y59; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=C4YG0Ib2; 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 1sqBOw-0006dL-PS; Mon, 16 Sep 2024 13:04:22 +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 1sqBOv-0006d9-EO for openvpn-devel@lists.sourceforge.net; Mon, 16 Sep 2024 13:04:21 +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=/4YWteeY2TLsjAOePs5HBiPSJ2ba3o1bp3MHYliBi7Q=; b=aSirWX6u/OkX/XgwNjX5loQpue pakTIwGqpiPBZ3d6aF7lb/Ff8xH7+n5hVi+vfiJWxjoPhsxjHW52uhbwgJNca3wtdaIxNnn5QE+P0 4Gy8Gtke7RY7omJHwP0KSNrghukN0p4TTaWkQpJhOIqOe3nUuquRufLkFS+CykCr+wDQ=; 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=/4YWteeY2TLsjAOePs5HBiPSJ2ba3o1bp3MHYliBi7Q=; b=g d977y59btr353PSVOEA9iuBmVtkMnhQJa2xRszvhOV35HIBvz71yo7k2neNWzG1+8lRgZsw1d5Q0I Wzw4BU+w+meIbQECKO6uKZx78wY1yH9fJiHJzEenUIpGT07R/Pf2M89euimRObYg2zO8NNzYQPyF5 ooQb7+KMZgk2IV10=; Received: from mail-wr1-f52.google.com ([209.85.221.52]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1sqBOu-0000xc-ES for openvpn-devel@lists.sourceforge.net; Mon, 16 Sep 2024 13:04:21 +0000 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-374c6187b6eso3360042f8f.0 for ; Mon, 16 Sep 2024 06:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1726491849; x=1727096649; 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=/4YWteeY2TLsjAOePs5HBiPSJ2ba3o1bp3MHYliBi7Q=; b=C4YG0Ib2milfiIoEpv9ii3o/YL8QogBq3rceoyixvX/NmqnOB9011IYUGsWGuxahtK h/DGcCKgDNDmAPD1W2mrWG0zJr9PmsIazSwyy7CaACZIHXFYH6KGOAqD+4O0rR5ZPwpG sLCaK2G1S2+WAUqBEW30KIceSHnvujgT4c8VxSLKKmsac5SijLypa87kQ31YxHFSdzch BrloANqJ+Cn0zkOM/rNeBQVt2ccTKe76Hs9QrUo2RHvoxjLumnL18dQ07nIaAThHbzVg p0SLQFDAfN/98ThiMTqJk3CBMrWAevgyrG3WLUJ7TKnhXP6QPY2A5yXak82ext7dFuVg g3LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726491849; x=1727096649; 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=/4YWteeY2TLsjAOePs5HBiPSJ2ba3o1bp3MHYliBi7Q=; b=lRk+nsheVmAuVY3x4PwZx08AVGdcryxze4+Ly+PfMBiLI6P7ec7pa18YZ0KSyLzEza qbO8pIpBVOF+/0VimyzdbgHEwaCXn6iS9lxH/GVO4fiFpRVR4lH1o6rLTYhYrNHeBPVB so6pZXtR4pUZHo2dLga9LQ2X7Gu18LTiM5hU2vAsUm9/oTOpAk+fXBR1dUkyk0wtHN22 InVcmnqukt0NNaNd021q1jtciKLOqq2nt/q7+NdTCiRS5l4wCVxVtzQx238h+T0RyNx/ xafizqau+tB9OXUR416GqkRzS8CWPZHDXQ4qQZRBZYvOxAs3Hqt35vVts4w0GCv0VtXl KGxA== X-Gm-Message-State: AOJu0YyE6buFUvENuYZkM0ItaXzyzBIWVU32UN/Cl04KMsnOKUHkJsxp mOsqhDyeyUwrc7AAl7++AhT6+BOOPLU0nNGBDCfJ9rXGvXOl8wujzHMV39cAw6JbILp2dfhsxpt i X-Received: by 2002:adf:8b9e:0:b0:374:c03e:22d4 with SMTP id ffacd0b85a97d-378c2cfeb7amr8421747f8f.1.1726491848398; Mon, 16 Sep 2024 06:04:08 -0700 (PDT) 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 ffacd0b85a97d-378e73e84a9sm7229308f8f.44.2024.09.16.06.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 06:04:08 -0700 (PDT) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Mon, 16 Sep 2024 13:04:07 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ib8f12516dbe294e21d3fed77478fb7660d4600c1 X-Gerrit-Change-Number: 749 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: cb8178e2548ad3defb747d95c8410db21a4baf6d References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-1.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.52 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.52 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_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1sqBOu-0000xc-ES Subject: [Openvpn-devel] [S] Change in openvpn[master]: Use print_tun_backend_driver instead of custom code to print type 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: 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?1810357938020669851?= X-GMAIL-MSGID: =?utf-8?q?1810357938020669851?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/749?usp=email to review the following change. Change subject: Use print_tun_backend_driver instead of custom code to print type ...................................................................... Use print_tun_backend_driver instead of custom code to print type Also show the device type that we opened always instead of certain conditions only. Change-Id: Ib8f12516dbe294e21d3fed77478fb7660d4600c1 Signed-off-by: Arne Schwabe --- M src/openvpn/init.c M src/openvpn/tun.c M src/openvpn/tun.h 3 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/49/749/1 diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 30ebf28..8d37a7f 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1876,6 +1876,7 @@ open_tun(c->options.dev, c->options.dev_type, c->options.dev_node, tt, &c->net_ctx); } + msg(M_INFO, "%s device [%s] opened", print_tun_backend_driver(tt->backend_driver), tt->actual_name); } @@ -2056,7 +2057,7 @@ do_close_tun_simple(struct context *c) { msg(D_CLOSE, "Closing %s interface", - dco_enabled(&c->options) ? "DCO" : "TUN/TAP"); + print_tun_backend_driver(c->c1.tuntap->backend_driver)); if (c->c1.tuntap) { diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 8f30c41..cef54d0 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6680,7 +6680,6 @@ * GUID using the registry */ tt->actual_name = string_alloc((const char *)actual_buffer, NULL); - msg(M_INFO, "%s device [%s] opened", print_tun_backend_driver(tt->backend_driver), tt->actual_name); tt->adapter_index = get_adapter_index(*device_guid); } diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index 5287e0c..c52fd22 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -363,6 +363,12 @@ void warn_on_use_of_common_subnets(openvpn_net_ctx_t *ctx); +/** + * Return a string representation of the tun backed driver type + */ +const char * +print_tun_backend_driver(enum tun_driver_type driver); + /* * Should ifconfig be called before or after * tun dev open? @@ -695,9 +701,6 @@ return tuntap_is_dco_win(tt) && (status < 0) && (openvpn_errno() == ERROR_NETNAME_DELETED); } -const char * -print_tun_backend_driver(enum tun_driver_type driver); - #else /* ifdef _WIN32 */ static inline bool