-
Notifications
You must be signed in to change notification settings - Fork 2
/
bro-musl.patch
92 lines (90 loc) · 2.11 KB
/
bro-musl.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
--- bro-orig/CMakeLists.txt
+++ bro/CMakeLists.txt
@@ -105,6 +105,29 @@
list(APPEND OPTLIBS ${LibGeoIP_LIBRARY})
endif ()
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ EXECUTE_PROCESS(
+ COMMAND cat /etc/os-release
+ COMMAND grep ^ID=
+ COMMAND awk -F= "{ print $2 }"
+ COMMAND tr "\n" " "
+ COMMAND sed "s/ //"
+ COMMAND sed "s/^\"//"
+ COMMAND sed "s/\"$//"
+ OUTPUT_VARIABLE SYSTEMD_ID
+ RESULT_VARIABLE SYSTEMD_ID_RESULT
+ )
+ if(${SYSTEMD_ID} STREQUAL "alpine")
+ find_package(FTS)
+ if (FTS_FOUND)
+ include_directories(BEFORE ${fts_INCLUDE_DIR})
+ list(APPEND OPTLIBS ${fts_LIBRARY})
+ else ()
+ message(FATAL_ERROR "missing fts and fts-dev for alpine linux.")
+ endif ()
+ endif ()
+endif ()
+
set(HAVE_PERFTOOLS false)
set(USE_PERFTOOLS_DEBUG false)
set(USE_PERFTOOLS_TCMALLOC false)
--- bro-orig/src/OSFinger.h
+++ bro/src/OSFinger.h
@@ -166,3 +166,57 @@
#define MATCHFUZZY 0x2
#endif
+
+// For musl-libc
+#ifndef TCPOPT_EOL
+# define TCPOPT_EOL 0
+#endif
+
+#ifndef TCPOPT_NOP
+# define TCPOPT_NOP 1
+#endif
+
+#ifndef TCPOPT_MAXSEG
+# define TCPOPT_MAXSEG 2
+#endif
+
+#ifndef TCPOLEN_MAXSEG
+# define TCPOLEN_MAXSEG 4
+#endif
+
+#ifndef TCPOPT_WINDOW
+# define TCPOPT_WINDOW 3
+#endif
+
+#ifndef TCPOLEN_WINDOW
+# define TCPOLEN_WINDOW 3
+#endif
+
+#ifndef TCPOPT_SACK_PERMITTED
+# define TCPOPT_SACK_PERMITTED 4 /* Experimental */
+#endif
+
+#ifndef TCPOLEN_SACK_PERMITTED
+# define TCPOLEN_SACK_PERMITTED 2
+#endif
+
+#ifndef TCPOPT_SACK
+# define TCPOPT_SACK 5 /* Experimental */
+#endif
+
+#ifndef TCPOPT_TIMESTAMP
+# define TCPOPT_TIMESTAMP 8
+#endif
+
+#ifndef TCPOLEN_TIMESTAMP
+# define TCPOLEN_TIMESTAMP 10
+#endif
+
+#ifndef TCPOLEN_TSTAMP_APPA
+# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
+#endif
+
+#ifndef TCPOPT_TSTAMP_HDR
+# define TCPOPT_TSTAMP_HDR \
+ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
+#endif