Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: ‘TCP_ULP’ was not declared in this scope #85

Open
majetideepak opened this issue Jan 12, 2023 · 1 comment
Open

Build failure: ‘TCP_ULP’ was not declared in this scope #85

majetideepak opened this issue Jan 12, 2023 · 1 comment

Comments

@majetideepak
Copy link

majetideepak commented Jan 12, 2023

I see the following errors on Amazon Linux 2 with g++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

[59/85] Building CXX object CMakeFiles/fizz.dir/experimental/ktls/KTLS.cpp.o
FAILED: CMakeFiles/fizz.dir/experimental/ktls/KTLS.cpp.o
/opt/rh/devtoolset-9/root/usr/bin/c++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_LOCALE -DGFLAGS_IS_A_DLL=0 -I/home/ec2-user/packages/fizz -mavx2 -mfma -mavx -mf16c -mlzcnt -std=c++17 -mbmi2 -Wno-register -Wno-deprecated-register -fPIC -std=c++17 -MD -MT CMakeFiles/fizz.dir/experimental/ktls/KTLS.cpp.o -MF CMakeFiles/fizz.dir/experimental/ktls/KTLS.cpp.o.d -o CMakeFiles/fizz.dir/experimental/ktls/KTLS.cpp.o -c /home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp: In lambda function:
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp:258:33: error: ‘TCP_ULP’ was not declared in this scope
258 | if (setsockopt(fd, SOL_TCP, TCP_ULP, "tls", sizeof("tls")) < 0) {
| ^~~~~~~
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp:266:24: error: ‘SOL_TLS’ was not declared in this scope; did you mean ‘SOL_TCP’?
266 | if (setsockopt(fd, SOL_TLS, TLS_RX, &fake_info, sizeof(fake_info)) < 0) {
| ^~~~~~~
| SOL_TCP
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp:269:24: error: ‘SOL_TLS’ was not declared in this scope; did you mean ‘SOL_TCP’?
269 | if (setsockopt(fd, SOL_TLS, TLS_TX, &fake_info, sizeof(fake_info)) < 0) {
| ^~~~~~~
| SOL_TCP
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp: In static member function ‘static folly::Expected<fizz::KTLSNetworkSocket, folly::exception_wrapper> fizz::KTLSNetworkSocket::tryEnableKTLS(folly::NetworkSocket, const fizz::KTLSDirectionalCryptoParamsfizz::TrafficDirection::Receive&, const fizz::KTLSDirectionalCryptoParamsfizz::TrafficDirection::Transmit&)’:
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp:305:46: error: ‘TCP_ULP’ was not declared in this scope
305 | if (folly::netops::setsockopt(fd, SOL_TCP, TCP_ULP, "tls", sizeof("tls")) <
| ^~~~~~~
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp:313:15: error: ‘SOL_TLS’ was not declared in this scope; did you mean ‘SOL_TCP’?
313 | fd, SOL_TLS, TLS_RX, rxs->data(), rxs->length()) < 0) {
| ^~~~~~~
| SOL_TCP
/home/ec2-user/packages/fizz/fizz/experimental/ktls/KTLS.cpp:319:15: error: ‘SOL_TLS’ was not declared in this scope; did you mean ‘SOL_TCP’?
319 | fd, SOL_TLS, TLS_TX, txs->data(), txs->length()) < 0) {
| ^~~~~~~
| SOL_TCP

@majetideepak
Copy link
Author

A potential fix could be

#ifndef TCP_ULP
# define TCP_ULP 31
#endif
#ifndef SOL_TLS
# define SOL_TLS 282
#endif

similar to
https://github.com/openssl/openssl/blob/master/include/internal/ktls.h#L245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant