svn commit: r335468 - head/sys/netinet
Matt Macy
mmacy at FreeBSD.org
Thu Jun 21 06:10:53 UTC 2018
Author: mmacy
Date: Thu Jun 21 06:10:52 2018
New Revision: 335468
URL: https://svnweb.freebsd.org/changeset/base/335468
Log:
udp_ctlinput: don't refer to unpcb after we drop the lock
Reported by: pho@
Modified:
head/sys/netinet/udp_usrreq.c
Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c Thu Jun 21 05:28:00 2018 (r335467)
+++ head/sys/netinet/udp_usrreq.c Thu Jun 21 06:10:52 2018 (r335468)
@@ -802,14 +802,15 @@ udp_common_ctlinput(int cmd, struct sockaddr *sa, void
INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL);
if (inp != NULL) {
struct udpcb *up;
+ void *ctx;
+ udp_tun_icmp_t func;
up = intoudpcb(inp);
- if (up->u_icmp_func != NULL) {
- INP_RUNLOCK(inp);
- (*up->u_icmp_func)(cmd, sa, vip, up->u_tun_ctx);
- } else {
- INP_RUNLOCK(inp);
- }
+ ctx = up->u_tun_ctx;
+ func = up->u_icmp_func;
+ INP_RUNLOCK(inp);
+ if (func != NULL)
+ (*func)(cmd, sa, vip, ctx);
}
}
} else
More information about the svn-src-all
mailing list