Openvpn3: hardware address of connecting client not being reported on Linux ?
Hello there,
I've been a long time user of openvpn. Until now I used openvpn 2 as a client, on my Linux box, and I wanted to switch to openvpn 3, but I've got a problem with the reported peer info.
More specifically, I'd like the MAC address of the connecting interface on my client, to be reported to the server.
The relevant source code portion is located in the following file:
openvpn3-core/openvpn/client/cliopt.hpp
And the lines of code are those ones:
// MAC address
if (pcc.pushPeerInfo())
{
std::string hwaddr = get_hwaddr();
if (!config.hw_addr_override.empty())
pi->emplace_back("IV_HWADDR", config.hw_addr_override);
else if (!hwaddr.empty())
pi->emplace_back("IV_HWADDR", hwaddr);
pi->emplace_back ("IV_SSL", get_ssl_library_version());
if (!config.platform_version.empty())
pi->emplace_back("IV_PLAT_VER", config.platform_version);
}"setenv PUSH_PEER_INFO" is of course defined in my config file. What I can see on my server is that, for example, IV_SSL is reported, but IV_PLAT_VER is not (probably because it is empty, but I don't care for this one), and IV_HWADDR isn't either, which annoys me a little more. The only reason why it wouldn't be reported seems to be that it cannot be determined by the call to "get_hwaddr()"...
This function is itself defined in the following file:
openvpn3-core/openvpn/netconf/hwaddr.hpp
But it seems that on a Linux platform, the different #if, #elif and #endif statements lead to a situation where almost all code is excluded from compilation, and an empty string is returned at the end of the function. So in short, nothing seems to be done on the Linux side, and so the whole thing simply cannot work.
Is my assumption right ? Any clues regarding this ?
Thank very much in advance.
Regards,
Bruno
Quoted 8 lines
But it seems that on a Linux platform, the different #if, #elif and #endif statements lead to a situation where almost all code is excluded from compilation, and an empty string is returned at the end of the function. So in short, nothing seems to be done on the Linux side, and so the whole thing simply cannot work.
Is my assumption right ? Any clues regarding this ?
Yes. Mac address reporting on Linux has never been implemented. If you look at hwaddr.hpp you see that there is no code for Linux.
IV_PLAT_VER needs to set by the UI, same as IV_GUI_VER. The UI can also override the mac address that is being. This for example done on android as implementation for the MAC address.
Arne
Quoted 11 lines · Arne Schwabe
Quoted 8 lines
But it seems that on a Linux platform, the different #if, #elif and #endif statements lead to a situation where almost all code is excluded from compilation, and an empty string is returned at the end of the function. So in short, nothing seems to be done on the Linux side, and so the whole thing simply cannot work.
Is my assumption right ? Any clues regarding this ?
Yes. Mac address reporting on Linux has never been implemented. If you look at hwaddr.hpp you see that there is no code for Linux.
Thanks Arne. So that explains it all. It had been implemented for openvpn 2, though, but the codebase seems very different.
Quoted 3 lines
IV_PLAT_VERneeds to set by the UI, same asIV_GUI_VER. The UI can also override the mac address that is being. This for example done on android as implementation for the MAC address.
Ok, nice trick. Still haven't figured out how to do it though. I traced it down to the parse_extras() function, but I'm having a hard time understanding how that config file parsing takes places.
Thanks very much anyway!
Best regards,
Bruno