git: 5c67f7c43e78 - main - udp: don't forget to initialize udpcb for UDPv6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 26 Jan 2023 18:16:54 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=5c67f7c43e78e4ab31bb115dda4a9cf8059a07a0
commit 5c67f7c43e78e4ab31bb115dda4a9cf8059a07a0
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2023-01-26 18:16:32 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2023-01-26 18:16:32 +0000
udp: don't forget to initialize udpcb for UDPv6
Reported by: tuexen
Fixes: 483fe96511ec02a3f077f9a59f1a96acb3640dea
---
sys/netinet6/udp6_usrreq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index df5e56076218..92cd4ab9cd39 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -986,8 +986,9 @@ udp6_abort(struct socket *so)
static int
udp6_attach(struct socket *so, int proto, struct thread *td)
{
- struct inpcb *inp;
struct inpcbinfo *pcbinfo;
+ struct inpcb *inp;
+ struct udpcb *up;
int error;
pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
@@ -1011,6 +1012,8 @@ udp6_attach(struct socket *so, int proto, struct thread *td)
* which may match an IPv4-mapped IPv6 address.
*/
inp->inp_ip_ttl = V_ip_defttl;
+ up = intoudpcb(inp);
+ bzero(&up->u_start_zero, u_zero_size);
INP_WUNLOCK(inp);
return (0);
}