From nobody Tue Oct 04 03:57:28 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 4MhP6c5rkHz4dlFX; Tue, 4 Oct 2022 03:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MhP6c5PPkz3rlG; Tue, 4 Oct 2022 03:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664855848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hj2LmNxethFXs8mGpC5qMms5OKnwN5LVRrxdRrokG2s=; b=tZVUVP1Lst9N3YHvM4ouD19x7W4vMw7EuXnQQfwjkZvOAviCQclu5GRdAMvUkxzBProVzE j37jF5pVDryxUmiz2lS6lzv+KyRK4+fUi31TQnUCEh75OQSRzJb0PQOo/1PBwNNLHfyMyy P2GEwkuf2vzt3dzfvokrHld3nnwzHMnRYIYso7ZuYPiIfHqtEIFtZxEeECcJHEtXrCUhqH 7hjW0mO34AGne1YnS2mc+xq9JpG+mWwDSKl6ucbFM4isM6Xo/Pyg9EDRlhwHwlslXIBJxd B3j1/xZQq+e+hLl+Hk7/IIpAHp58QowpL4TmO6Bct6rLCqaAyTYM5ZWjRR8OYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MhP6c4SsMzR4x; Tue, 4 Oct 2022 03:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2943vS6e015224; Tue, 4 Oct 2022 03:57:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2943vSCx015223; Tue, 4 Oct 2022 03:57:28 GMT (envelope-from git) Date: Tue, 4 Oct 2022 03:57:28 GMT Message-Id: <202210040357.2943vSCx015223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: bb77f0c20493 - main - udp: typedef udp tunneling functions to functions, not pointers 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb77f0c2049311f0661c2493838d81a5a66c449c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664855848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hj2LmNxethFXs8mGpC5qMms5OKnwN5LVRrxdRrokG2s=; b=bq1JePFfTnP2pWH4ru1/psz/ALJzvinU3/hHA8gMel4g0Pc2/R4bu7myv0/XWUUCyHCZ9P dtLdErbuD83SKAvo1Z62fn4gAoIxnDXlpJpa8DQXZYRpkHD0LnLZCO/rsGzRY7gfU86C89 cKzx/vuV0nyXlBp7ZwSyZhX1NQVHY8hOu5GKkKK2PyogAhwPGRK3g6QLh03r1Bzkmxj6kE iz0w9LTRbrh8Y+3SVz1pITAPEORLNLqoRBu1p8KzoDWKHfhWF/BJjKBVAC4VWVuBRoKzAA js38cw+h3fatMD5cPdgMFRFvGNGTqpS1NAmFwgimpaaUhvtuqJrQ6DGR53OdsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664855848; a=rsa-sha256; cv=none; b=j5lRPNA14UA0tJG66R7ALTdJmHxF/4B6GFPEtZIPCv1rHDI8YTGMDmdSAi6rbsxQ4NCMib RVqHmgQqikv2RmUpjJKM+FVWimnoVqO7DJM9B9/l7rDEvoGws3lyrv/z1fYHMWfrMFtQ5U lETrn9GcdFE9+13KG2yCyL+G8wBg995q2M/wm7slUOc3fiU8D1Ge3ncMg/X43rPZ9dZHqq En0HXhSCO0AP1b3lYmbkfKGWuw2IpBMbxZYouFq+2TNKhoTcawrU8RJqqtNmIYvIU5cjJl j8IK0KnbnFZFsU+vFO/i+Ybld24xt00X6XIb3RfQ4ls9LLAmWkqYKW9U5BsqYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=bb77f0c2049311f0661c2493838d81a5a66c449c commit bb77f0c2049311f0661c2493838d81a5a66c449c Author: Gleb Smirnoff AuthorDate: 2022-10-04 03:53:04 +0000 Commit: Gleb Smirnoff CommitDate: 2022-10-04 03:53:04 +0000 udp: typedef udp tunneling functions to functions, not pointers With this change one can make a forward declaration of a function that is of UDP tunneling type. Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36724 --- sys/netinet/udp_usrreq.c | 2 +- sys/netinet/udp_var.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 3cbeb4a5e50f..112e343853bc 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -785,7 +785,7 @@ udp_common_ctlinput(int cmd, struct sockaddr *sa, void *vip, if (inp != NULL) { struct udpcb *up; void *ctx; - udp_tun_icmp_t func; + udp_tun_icmp_t *func; up = intoudpcb(inp); ctx = up->u_tun_ctx; diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index 5fb86aa656b2..2f3db518b26a 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -62,16 +62,16 @@ struct inpcb; struct mbuf; #ifdef _KERNEL -typedef bool(*udp_tun_func_t)(struct mbuf *, int, struct inpcb *, - const struct sockaddr *, void *); -typedef void(*udp_tun_icmp_t)(int, struct sockaddr *, void *, void *); +typedef bool udp_tun_func_t(struct mbuf *, int, struct inpcb *, + const struct sockaddr *, void *); +typedef void udp_tun_icmp_t(int, struct sockaddr *, void *, void *); /* * UDP control block; one per udp. */ struct udpcb { - udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */ - udp_tun_icmp_t u_icmp_func; /* UDP kernel tunneling icmp callback */ + udp_tun_func_t *u_tun_func; /* UDP kernel tunneling callback. */ + udp_tun_icmp_t *u_icmp_func; /* UDP kernel tunneling icmp callback */ u_int u_flags; /* Generic UDP flags. */ uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ uint16_t u_txcslen; /* Coverage for outgoing datagrams. */