Compare commits

...

3 Commits

Author SHA1 Message Date
Nick Cao
f3e05f4a86
Merge 4559e6d47bb69fda0fbd3fb4b7d04ddb1cf5e2ae into d1a9bcc4fb5a7c4f65e96de0f0561af507f627b2 2023-10-11 15:06:50 -06:00
yancey
d1a9bcc4fb try to fix linux 6.5 compile 2023-10-07 08:26:10 -04:00
Nick Cao
4559e6d47b
Add install target to CMakeLists.txt 2023-05-13 12:37:27 +08:00
3 changed files with 6 additions and 4 deletions

View File

@ -33,3 +33,5 @@ target_link_libraries(udp2raw rt)
target_link_libraries(udp2raw pthread) target_link_libraries(udp2raw pthread)
include_directories(SYSTEM "libev") include_directories(SYSTEM "libev")
include_directories(".") include_directories(".")
install(TARGETS udp2raw)

View File

@ -702,7 +702,7 @@ void init_filter(int port) {
} }
} }
int dummy; int dummy=0;
int ret = setsockopt(raw_recv_fd, SOL_SOCKET, SO_DETACH_FILTER, &dummy, sizeof(dummy)); // in case i forgot to remove int ret = setsockopt(raw_recv_fd, SOL_SOCKET, SO_DETACH_FILTER, &dummy, sizeof(dummy)); // in case i forgot to remove
if (ret != 0) { if (ret != 0) {
@ -841,7 +841,7 @@ void init_filter(int port) {
void remove_filter() { void remove_filter() {
filter_port = 0; filter_port = 0;
#ifdef UDP2RAW_LINUX #ifdef UDP2RAW_LINUX
int dummy; int dummy=0;
int ret = setsockopt(raw_recv_fd, SOL_SOCKET, SO_DETACH_FILTER, &dummy, sizeof(dummy)); int ret = setsockopt(raw_recv_fd, SOL_SOCKET, SO_DETACH_FILTER, &dummy, sizeof(dummy));
if (ret != 0) { if (ret != 0) {
mylog(log_debug, "error remove fiter\n"); mylog(log_debug, "error remove fiter\n");

View File

@ -226,12 +226,12 @@ struct packet_info_t // todo change this to union
bool has_ts; bool has_ts;
i32_t data_len;
#ifdef UDP2RAW_LINUX #ifdef UDP2RAW_LINUX
sockaddr_ll addr_ll; sockaddr_ll addr_ll;
#endif #endif
i32_t data_len;
packet_info_t(); packet_info_t();
}; };