From patchwork Wed Nov 15 13:45:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3436 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:3c06:b0:f2:62eb:61c1 with SMTP id e6csp2925984dys; Wed, 15 Nov 2023 05:45:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGx4mWcXpItSm55Orhovb3PH8RSy3hJvmLaDYC3FCQTAl1lRb+OefGNY/1tgU3uy3mggpux X-Received: by 2002:a05:6a20:7d98:b0:187:4a56:9a06 with SMTP id v24-20020a056a207d9800b001874a569a06mr3115827pzj.5.1700055946531; Wed, 15 Nov 2023 05:45:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700055946; cv=none; d=google.com; s=arc-20160816; b=l7se0lotJ3KWU1kq742EJ6u9RHxIdF+IkfxZEbr5sMF1grOwe36emsVFAt4BhwSBu+ AI7cctFdeSF1MtE29CUO+af7vmwN16SPI4FA/rxDxasprIhQbdcdODZTmExlKWJKQVhu NzmYLLFUDiu1bQrdvFHM3N6+DOEYg3ZYY64/aHvHcVPT1Yz/rQ33wDrqj0a1b5LmctPp Al8K8cTbkw+xFZ1RJ5cv6UCbVfzGEHYEXFXL8NUG9eJLBVKnSPQ94or29tJtcEtFzu8S hMbCYL/ipKzMB80JszTNzb+GAWjsO8d2Di9x5ZtgT/rrexQotpz4hRERmc63pkhFyEcB GCbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=iVfyrupYJoPjEQ11UOsaJIZEG+aVF6y59RmwIQQOM6w=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=IlCXLmNsmot4KyM4RduWUkJho/TUcg5ooFDxG+f4XmdA3RDD0evau1LjxDT5K9sser 4ul3uXXRhqFhIBIlPtOVvQ9PuSKbLKF4Ni+rGYOX/cluoL8bURBdKQpHNE3tdicWQavs dlztpowZK3sIsFWm7ATeLhw1DxirtFMlYArYwG85YXr73f6Luaw8ly7TU+mpnp4Zzsgc BiJ8zRx3i4hOk5HK0mUWSkpm29OsO0SUpLWLCGNTp9D3EZlQwRCkiIZiLWG4CrRffAQu Wn85hJTihRZNYgSBFgPad95GoR1SDP2dg4SiqqE1WI0+tGtoKu7dKnC2ZMDYwDgI+kRF 7YpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=HpJJok5f; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eeldxKNU; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=BzK7Kw7U; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id by28-20020a056a02059c00b005b90972529dsi10715157pgb.456.2023.11.15.05.45.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2023 05:45:46 -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=HpJJok5f; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eeldxKNU; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=BzK7Kw7U; 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 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 1r3GCq-0008Hv-HO; Wed, 15 Nov 2023 13:45:23 +0000 Received: from [172.30.20.202] (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 1r3GCo-0008HX-He for openvpn-devel@lists.sourceforge.net; Wed, 15 Nov 2023 13:45: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=z2pIq/w6bk8pZ0wvRY2P5bYP6ac5n6LDjqkToLbInq8=; b=HpJJok5frGniomH1IhLhXr+Y56 m69wfLhv8tfnnb6UCy2qC8H5a54hS25Tui4Lg0Qi51pGVRNnVkYT/nz/YR5tVZe7RJir65tBTASZc 0GHtPeP6CfuvIysXyViGimSmYy5/JpR/qBpQmSeTRlqo/IPT5FvvL5dXZPo7s2Kjze+M=; 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=z2pIq/w6bk8pZ0wvRY2P5bYP6ac5n6LDjqkToLbInq8=; b=e eldxKNU/GEe34lKK57tA4eFcFBT+QUtsAm8i3v/5+SZIkd55CYfwhaOjKPDJ5SfBini0qATTCt2al QAEfbQgHdGaQTL8J4CedqLTisFtbjqz7s8BNzy5YPDGF+1+MX6NJf/qisCkw0/EAykUzIHs9DpIdi ZCnwhBmxGQ8h7+E4=; Received: from mail-wm1-f48.google.com ([209.85.128.48]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1r3GCl-0000No-BF for openvpn-devel@lists.sourceforge.net; Wed, 15 Nov 2023 13:45:21 +0000 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4083cd3917eso55885295e9.3 for ; Wed, 15 Nov 2023 05:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1700055913; x=1700660713; 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=z2pIq/w6bk8pZ0wvRY2P5bYP6ac5n6LDjqkToLbInq8=; b=BzK7Kw7UeSIQT87+yBw7V9pWSmSzSbRf9daxeZfd72j69fd7HfEM3Ij+QLbX8xNV1V Gka5IEG5+JNXPXnkIMWWLNs6x5100g9NIIrOhRc5zvlVsoydL3EtJR2BwzTNQB72iyta Rg1lW5/xwPqxA+J/kwHgXzJGWzA5gTRje1pOV/pxN/X58YbUceSp4+IVU4EcQc+eKaCN NaxFYpIu+w1E+UEffcuOdY0Thv79WzUTCT+FhxRoLEH7fMbYsr7n0HZa9NbIdvJqjcMD 1y+oHisVGRxHE3VdIGxhNikSnTpXoW+WkuHmsbx8EFId1DS1Cu0Wmm085vwdxws+gFf3 NQEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700055913; x=1700660713; 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=z2pIq/w6bk8pZ0wvRY2P5bYP6ac5n6LDjqkToLbInq8=; b=GkeUmRH9wgb2BG6+r8fTklzy+j6amGB092vhkKNki9lxzN62wD6vEJMmZdVjt74aLT jtFUN3jQMyjdc6cRJFu/72RJCpLRyLZJKvEMINkiGxb77Bcob/oB3a2G/z1p/J651yln QnEHLVkoMGmSIg1L6XIGVjaPmM50PyiXM38fQDuvTk3m2mKpQ0L0q+IBwTVg1LjFPOxZ kDic8fpTc7eNsBWP5GD4K3XOcWgsyjXNylB8OSDCwZZHTknQYnrrrMb5IEd2XluGDcpc Pw/BrLUcDL/6Ab6XAeBjgmEp6PhYN/V+S/43xj03YfQXqNW9jLMJfvIsvkFO5XhMZDz6 DQZQ== X-Gm-Message-State: AOJu0Yw536Gfhahc4SuBMr3ga86qsbz/dA2w0r5cfiuyPIWSvLAegBjU b/+errCAm7Js4LYkH7Ow1Ft+joJ8ppEh62viyho= X-Received: by 2002:a05:600c:310f:b0:408:3ac4:dc3f with SMTP id g15-20020a05600c310f00b004083ac4dc3fmr11223507wmo.29.1700055912919; Wed, 15 Nov 2023 05:45:12 -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 i10-20020a05600c354a00b004053e9276easm21168026wmq.32.2023.11.15.05.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:45:12 -0800 (PST) From: "ordex (Code Review)" X-Google-Original-From: "ordex (Code Review)" X-Gerrit-PatchSet: 1 Date: Wed, 15 Nov 2023 13:45:12 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I7a3349c7de4202b5eb2f576e3f8a82a9af6f7f31 X-Gerrit-Change-Number: 435 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 20e35de9796194434fedb86b8fe6817261f6f2bd References: Message-ID: <66f4e0fa28801d0720f6992c646f3d790c2cfeb3-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-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, 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.48 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.48 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_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1r3GCl-0000No-BF Subject: [Openvpn-devel] [S] Change in openvpn[master]: if a local IPv6 address is provided, socket must be v6-only 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: a@unstable.cc, 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?1782637864140141050?= X-GMAIL-MSGID: =?utf-8?q?1782637864140141050?= 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/+/435?usp=email to review the following change. Change subject: if a local IPv6 address is provided, socket must be v6-only ...................................................................... if a local IPv6 address is provided, socket must be v6-only Change-Id: I7a3349c7de4202b5eb2f576e3f8a82a9af6f7f31 Signed-off-by: Antonio Quartulli --- M src/openvpn/socket.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/35/435/1 diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index f2bd624..17bd263 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1108,9 +1108,15 @@ } else { + bool v6only = sock->info.bind_ipv6_only; + + /* force binding IPv6-only if an address was specified + * an it is a IPv6 */ + if (sock->local_host && ai_family == AF_INET6) + v6only = true; + socket_bind(sock->sd, sock->info.lsa->bind_local, - ai_family, - "TCP/UDP", sock->info.bind_ipv6_only); + ai_family, "TCP/UDP", v6only); } } }