Skip to content

Commit 4f9bd9f

Browse files
pasisAlexanderGrissik
authored andcommitted
issue: 4424775 Return EEXIST on duplicate setsockopt(TCP_ULP)
Fail setsockopt() instead of resetting the TLS offload state. This change improve robustness and makes the behavior be compliant to kernel. Signed-off-by: Dmytro Podgornyi <[email protected]>
1 parent 2d68953 commit 4f9bd9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core/sock/sockinfo_tcp.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3758,6 +3758,13 @@ int sockinfo_tcp::tcp_setsockopt(int __level, int __optname, __const void *__opt
37583758
ret = -1;
37593759
break;
37603760
}
3761+
ops = dynamic_cast<sockinfo_tcp_ops_tls *>(m_ops);
3762+
if (ops) {
3763+
si_tcp_loginfo("(TCP_ULP) val: tls, ULP is already TLS");
3764+
errno = EEXIST;
3765+
ret = -1;
3766+
break;
3767+
}
37613768
ops = new sockinfo_tcp_ops_tls(this);
37623769
}
37633770
} else

0 commit comments

Comments
 (0)