Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152001497
D14808.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
932 B
Referenced Files
None
Subscribers
None
D14808.id.diff
View Options
Index: sys/netinet6/ip6_output.c
===================================================================
--- sys/netinet6/ip6_output.c
+++ sys/netinet6/ip6_output.c
@@ -2249,10 +2249,12 @@
struct socket *so, struct sockopt *sopt)
{
struct ip6_pktopts *opt = *pktopt;
+ struct ip6_pktopts *tmp_opt = *pktopt;
int error = 0;
struct thread *td = sopt->sopt_td;
+ struct inpcb *in6p = sotoinpcb(so);
- INP_WLOCK_ASSERT(sotoinpcb(so));
+ INP_WLOCK_ASSERT(in6p);
/* turn off any old options. */
if (opt) {
@@ -2263,8 +2265,15 @@
printf("ip6_pcbopts: all specified options are cleared.\n");
#endif
ip6_clearpktopts(opt, -1);
- } else
- opt = malloc(sizeof(*opt), M_IP6OPT, M_WAITOK);
+ } else {
+ INP_WUNLOCK(in6p);
+ tmp_opt = malloc(sizeof(*opt), M_IP6OPT, M_WAITOK);
+ INP_WLOCK(in6p);
+ if (!opt)
+ opt = tmp_opt;
+ else
+ free(tmp_opt, M_IP6OPT);
+ }
*pktopt = NULL;
if (!m || m->m_len == 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 13, 12:57 AM (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31384787
Default Alt Text
D14808.id.diff (932 B)
Attached To
Mode
D14808: do not hold in6p lock during malloc in ip6_pcbopts()
Attached
Detach File
Event Timeline
Log In to Comment