56 lines
2.2 KiB
Diff
56 lines
2.2 KiB
Diff
|
|
diff -Naur a/third_party/gloo/gloo/common/linux.cc b/third_party/gloo/gloo/common/linux.cc
|
||
|
|
--- a/third_party/gloo/gloo/common/linux.cc 2022-03-11 01:01:52.000000000 +0800
|
||
|
|
+++ b/third_party/gloo/gloo/common/linux.cc 2023-02-16 11:09:11.493631531 +0800
|
||
|
|
@@ -187,29 +187,28 @@
|
||
|
|
static int getInterfaceSpeedGLinkSettings(int sock, struct ifreq* ifr) {
|
||
|
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
|
||
|
|
constexpr auto link_mode_data_nwords = 3 * 127;
|
||
|
|
- struct {
|
||
|
|
- struct ethtool_link_settings req;
|
||
|
|
- __u32 link_mode_data[link_mode_data_nwords];
|
||
|
|
- } ecmd;
|
||
|
|
+ constexpr auto bufsize = sizeof(struct ethtool_link_settings) + sizeof(__u32)*link_mode_data_nwords;
|
||
|
|
+ char buf[bufsize];
|
||
|
|
+ struct ethtool_link_settings* ecmd = (struct ethtool_link_settings*)buf;
|
||
|
|
int rv;
|
||
|
|
|
||
|
|
- ifr->ifr_data = (__caddr_t)&ecmd;
|
||
|
|
- memset(&ecmd, 0, sizeof(ecmd));
|
||
|
|
- ecmd.req.cmd = ETHTOOL_GLINKSETTINGS;
|
||
|
|
+ ifr->ifr_data = (__caddr_t)buf;
|
||
|
|
+ memset(buf, 0, bufsize);
|
||
|
|
+ ecmd->cmd = ETHTOOL_GLINKSETTINGS;
|
||
|
|
|
||
|
|
rv = ioctl(sock, SIOCETHTOOL, ifr);
|
||
|
|
- if (rv < 0 || ecmd.req.link_mode_masks_nwords >= 0) {
|
||
|
|
+ if (rv < 0 || ecmd->link_mode_masks_nwords >= 0) {
|
||
|
|
return SPEED_UNKNOWN;
|
||
|
|
}
|
||
|
|
|
||
|
|
- ecmd.req.cmd = ETHTOOL_GLINKSETTINGS;
|
||
|
|
- ecmd.req.link_mode_masks_nwords = -ecmd.req.link_mode_masks_nwords;
|
||
|
|
+ ecmd->cmd = ETHTOOL_GLINKSETTINGS;
|
||
|
|
+ ecmd->link_mode_masks_nwords = - (ecmd->link_mode_masks_nwords);
|
||
|
|
rv = ioctl(sock, SIOCETHTOOL, ifr);
|
||
|
|
if (rv < 0) {
|
||
|
|
return SPEED_UNKNOWN;
|
||
|
|
}
|
||
|
|
|
||
|
|
- return ecmd.req.speed;
|
||
|
|
+ return ecmd->speed;
|
||
|
|
#else
|
||
|
|
(void)sock;
|
||
|
|
(void)ifr;
|
||
|
|
diff -Naur a/third_party/gloo/gloo/test/tls_tcp_test.cc b/third_party/gloo/gloo/test/tls_tcp_test.cc
|
||
|
|
--- a/third_party/gloo/gloo/test/tls_tcp_test.cc 2022-03-11 01:01:52.000000000 +0800
|
||
|
|
+++ b/third_party/gloo/gloo/test/tls_tcp_test.cc 2023-02-16 11:12:33.779302224 +0800
|
||
|
|
@@ -72,7 +72,7 @@
|
||
|
|
}
|
||
|
|
} catch (::gloo::IoException e) {
|
||
|
|
exception_thrown = true;
|
||
|
|
- ASSERT_THAT(e.what(), ::testing::ContainsRegex("unknown ca"));
|
||
|
|
+ ASSERT_THAT(e.what(), ::testing::ContainsRegex("[unknown ca|Connect timeout|Connection refused]"));
|
||
|
|
} catch (::gloo::EnforceNotMet e) {
|
||
|
|
exception_thrown = true;
|
||
|
|
ASSERT_THAT(e.what(),
|