From nobody Wed Aug 17 16:41:57 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M7DLx24Yzz4Zsfs for ; Wed, 17 Aug 2022 16:42:01 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7DLw34Kvz3qFK for ; Wed, 17 Aug 2022 16:42:00 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f42.google.com with SMTP id n4so16822419wrp.10 for ; Wed, 17 Aug 2022 09:42:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc; bh=3Ys1cZ+VeyHzSVlYpA6hsKLtiMQ+UB1rgxZ4F2WWe6g=; b=mVBrwGScTpB/6bk3aWxUu+iJ7+s8+4CFtuGM1YAkPv14nJwfMW+PP53YOhxxqz8kDF fnQsoEOp1fFrGJJUItfNtMlRka58sjWpuU/jJQc/AhuHSIZOGpWyWjF3bxd4nm1mZ3v+ YoqOzWBTKQOykDBeDOruNIFP6xAWoStt6KIqLBnf2/XVez1pHxgeMQJ3gEFEkXl/KHzS Y38H1nF9OE4Bleu3YnSbvkspQK9qSDlVgIgfJWEicf5m/aZCNqeDHUSuXXw1+J4UiF3P JcZuVrujLn25zsV+vRxStBhCqFFe6lF1lZEnYmhmAp9+C+kZ0EGPctmxUyOPlLoZ6FpD D02Q== X-Gm-Message-State: ACgBeo1Jz+YDEFNdPF7zVKFlEeumME/Z3TBB4VePquvrV3PKXAoqC2X8 x2idBqwqVMi0kmAomBz0HIEQoQ== X-Google-Smtp-Source: AA6agR4eh+KJ3jReSPQuZ6x7sdqgiXpn4D/gGjWSRzX8g380lGAh1IyWvGdYXWqVHxMsGUgKaE1T4g== X-Received: by 2002:a5d:4983:0:b0:220:5fee:1d79 with SMTP id r3-20020a5d4983000000b002205fee1d79mr15282022wrq.62.1660754518878; Wed, 17 Aug 2022 09:41:58 -0700 (PDT) Received: from smtpclient.apple (global-5-141.n-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id k40-20020a05600c1ca800b003a5f3de6fddsm2779929wms.25.2022.08.17.09.41.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Aug 2022 09:41:58 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: git: c93db4abf454 - main - udp: call UDP methods from UDP over IPv6 directly From: Jessica Clarke In-Reply-To: Date: Wed, 17 Aug 2022 17:41:57 +0100 Cc: Gleb Smirnoff , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7DA094FB-3E0F-4784-A538-CB2EE78A5275@freebsd.org> References: <202208161940.27GJercD039480@gitrepo.freebsd.org> <62dca1e0-8d66-6291-149e-5785af0e2658@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Rspamd-Queue-Id: 4M7DLw34Kvz3qFK X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.42:from]; FREEFALL_USER(0.00)[jrtc27]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.42:from] X-ThisMailContainsUnwantedMimeParts: N On 17 Aug 2022, at 17:37, John Baldwin wrote: >=20 > On 8/17/22 9:19 AM, Gleb Smirnoff wrote: >> John, >> On Wed, Aug 17, 2022 at 09:04:08AM -0700, John Baldwin wrote: >> J> > diff --git a/sys/netinet6/udp6_usrreq.c = b/sys/netinet6/udp6_usrreq.c >> J> > index a7bdfce97707..6a3ac2abd90b 100644 >> J> > --- a/sys/netinet6/udp6_usrreq.c >> J> > +++ b/sys/netinet6/udp6_usrreq.c >> J> > @@ -131,12 +131,18 @@ VNET_DEFINE(int, zero_checksum_port) =3D = 0; >> J> > SYSCTL_INT(_net_inet6_udp6, OID_AUTO, rfc6935_port, CTLFLAG_VNET = | CTLFLAG_RW, >> J> > &VNET_NAME(zero_checksum_port), 0, >> J> > "Zero UDP checksum allowed for traffic to/from this port."); >> J> > + >> J> > + >> J> > +/* netinet/udp_usrreqs.c */ >> J> > +pr_abort_t udp_abort; >> J> > +pr_disconnect_t udp_disconnect; >> J> > +pr_send_t udp_send; >> J> > + >> J> >> J> Oof, can you please put these in a header instead? = would seem to be >> J> a good candidate. >> I actually don't want to share these functions to anybody. Sometimes = we are >> in a situation when two compilation units are historically separated, >> while they need to call into each other functions, which by design = are private. >=20 > Putting them in a header doesn't really change that. Anyone can add a = local > prototype and call it. Even better, they can add a _wrong_ prototype = and > call it with the wrong arguments. Or more likely, if the original = function changes > then previously working code breaks and the compiler won't catch this. = In this > specific case you mostly sidestep that due to using a typedef, but in = general the > wrong prototype problem is the reason to store prototypes in headers. >=20 > I'm not sure that "I don't trust other developers" is a valid reason = to avoid the > use of headers, or at least I'm not sure it outweighs "code breaks = without > the compiler noticing in the future". I'd rather signpost it in the = header > clarifying when it is allowed to be used (e.g. /* Shared between = udp*_usrreq.c. */ > or the like) Or if you really want to make it clearly signposted, add a = udp_usrreq_private.h. Jess