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

Fix wrong struct layout in getInterfaceSpeedGLinkSettings #382

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions gloo/common/linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ const std::string& infinibandToBusID(const std::string& name) {
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 {
__u32 link_mode_data[link_mode_data_nwords];
union {
struct ethtool_link_settings req;
struct { // Only to provide the memory
__u32 link_mode_data[link_mode_data_nwords];
struct ethtool_link_settings dummy;
};
} ecmd;
int rv;

Expand Down