openvpn3 icon indicating copy to clipboard operation
openvpn3 copied to clipboard

No adapter domain suffix with DCO driver on Windows (in ovpnagent mode)

Open savely-krasovsky opened this issue 3 months ago • 1 comments

I came from this issue: https://github.com/OpenVPN/openvpn/issues/306, but it seems like OpenVPN3 should support it. However after debugging it a bit I saw this, log from DCO agent:

Set adapter domain suffix: 'COMPANY'

Log from Wintun:

Set adapter domain suffix: 'COMPANY' {15E232D8-514C-4947-A0F6-F8C27904B8F4}

As you can see, Wintun properly logs not only suffix, but also interface GUID.

But it should be logged if everything would be okay:

virtual std::string to_string() const override
{
     return "Set adapter domain suffix: '" + search_domain + "' " + tap_guid;
}

Because tap_guid variable is empty for some reason, the code which manipulates the registry:

virtual void execute(std::ostream &os) override
    {
        os << to_string() << std::endl;

        LONG status;
        Win::RegKey key;
        const std::string reg_key_name = "SYSTEM\\CurrentControlSet\\services\\Tcpip\\Parameters\\Interfaces\\" + tap_guid;
        status = ::RegOpenKeyExA(HKEY_LOCAL_MACHINE,
                                 reg_key_name.c_str(),
                                 0,
                                 KEY_READ | KEY_WRITE,
                                 key.ref());
        // code ...

Writes in a complitely wrong place, in the SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces root, and I clearly see it: изображение

It's definitely a bug, currently trying to debug the reason behind this behavior.

savely-krasovsky avatar Apr 03 '24 13:04 savely-krasovsky