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
|
--- third_party/webrtc/base/physicalsocketserver.cc.orig 2017-04-19 19:07:52 UTC
+++ third_party/webrtc/base/physicalsocketserver.cc
@@ -61,7 +61,11 @@ typedef void* SockOptArg;
int64_t GetSocketRecvTimestamp(int socket) {
struct timeval tv_ioctl;
+#if defined(WEBRTC_BSD)
+ int ret = ioctl(socket, SO_TIMESTAMP, &tv_ioctl);
+#else
int ret = ioctl(socket, SIOCGSTAMP, &tv_ioctl);
+#endif
if (ret != 0)
return -1;
int64_t timestamp =
@@ -302,7 +306,7 @@ int PhysicalSocket::GetOption(Option opt
socklen_t optlen = sizeof(*value);
int ret = ::getsockopt(s_, slevel, sopt, (SockOptArg)value, &optlen);
if (ret != -1 && opt == OPT_DONTFRAGMENT) {
-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
+#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
*value = (*value != IP_PMTUDISC_DONT) ? 1 : 0;
#endif
}
@@ -315,7 +319,7 @@ int PhysicalSocket::SetOption(Option opt
if (TranslateOption(opt, &slevel, &sopt) == -1)
return -1;
if (opt == OPT_DONTFRAGMENT) {
-#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
+#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_BSD)
value = (value) ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
#endif
}
@@ -597,10 +601,10 @@ int PhysicalSocket::TranslateOption(Opti
*slevel = IPPROTO_IP;
*sopt = IP_DONTFRAGMENT;
break;
-#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__)
+#elif defined(WEBRTC_MAC) || defined(WEBRTC_BSD) || defined(__native_client__)
LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
return -1;
-#elif defined(WEBRTC_POSIX)
+#elif defined(WEBRTC_POSIX) && !defined(WEBRTC_BSD)
*slevel = IPPROTO_IP;
*sopt = IP_MTU_DISCOVER;
break;
|