aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2022-10-04 03:53:04 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2022-10-04 03:53:04 +0000
commitbb77f0c2049311f0661c2493838d81a5a66c449c (patch)
tree2ac5dbcc81f82239a42a86a668a698dedc6a8be7
parent24b96f35b9113919602b8e0e6177ac4dfb848482 (diff)
downloadsrc-bb77f0c2049311f0661c2493838d81a5a66c449c.tar.gz
src-bb77f0c2049311f0661c2493838d81a5a66c449c.zip
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
-rw-r--r--sys/netinet/udp_usrreq.c2
-rw-r--r--sys/netinet/udp_var.h10
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. */