Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146019892
D14623.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14623.diff
View Options
Index: head/sys/netipsec/xform_tcp.c
===================================================================
--- head/sys/netipsec/xform_tcp.c
+++ head/sys/netipsec/xform_tcp.c
@@ -80,23 +80,24 @@
struct tcpcb *tp;
int error, optval;
- INP_WLOCK_ASSERT(inp);
if (sopt->sopt_name != TCP_MD5SIG) {
- INP_WUNLOCK(inp);
return (ENOPROTOOPT);
}
- tp = intotcpcb(inp);
if (sopt->sopt_dir == SOPT_GET) {
+ INP_RLOCK(inp);
+ if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
+ INP_RUNLOCK(inp);
+ return (ECONNRESET);
+ }
+ tp = intotcpcb(inp);
optval = (tp->t_flags & TF_SIGNATURE) ? 1 : 0;
- INP_WUNLOCK(inp);
+ INP_RUNLOCK(inp);
/* On success return with released INP_WLOCK */
return (sooptcopyout(sopt, &optval, sizeof(optval)));
}
- INP_WUNLOCK(inp);
-
error = sooptcopyin(sopt, &optval, sizeof(optval), sizeof(optval));
if (error != 0)
return (error);
@@ -107,12 +108,13 @@
INP_WUNLOCK(inp);
return (ECONNRESET);
}
+ tp = intotcpcb(inp);
if (optval > 0)
tp->t_flags |= TF_SIGNATURE;
else
tp->t_flags &= ~TF_SIGNATURE;
- /* On success return with acquired INP_WLOCK */
+ INP_WUNLOCK(inp);
return (error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 28, 2:31 AM (16 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29048279
Default Alt Text
D14623.diff (1 KB)
Attached To
Mode
D14623: fix locking within tcp_ipsec_pcbctl() to match ipsec4_pcbctl(), ipsec4_pcbctl()
Attached
Detach File
Event Timeline
Log In to Comment