0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00

dco-win: pass mss to kernel

Pass mss_fix value to dco-win driver via set_peer call.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
This commit is contained in:
Lev Stipakov 2022-04-29 14:56:02 +03:00
parent 2b7f97c78b
commit 3d662431fa
3 changed files with 11 additions and 0 deletions

View File

@ -608,6 +608,9 @@ namespace openvpn {
// initialize data channel after pushed options have been processed
Base::init_data_channel();
// we got pushed options and initializated crypto - now we can push mss to dco
tun->adjust_mss(conf().mss_fix);
// Allow ProtoContext to suggest an alignment adjustment
// hint for transport layer.
transport->reset_align_adjust(Base::align_adjust_hint());

View File

@ -85,6 +85,12 @@ public:
std::string tun_name() const override { return "ovpn-dco-win"; }
void adjust_mss(int mss) override
{
OVPN_SET_PEER peer {-1, -1, mss};
dco_ioctl_(OVPN_IOCTL_SET_PEER, &peer, sizeof(peer));
}
IP::Addr server_endpoint_addr() const override {
return IP::Addr::from_asio(endpoint_.address());
}

View File

@ -52,6 +52,8 @@ namespace openvpn {
virtual std::string vpn_gw4() const { return std::string(); } // VPN gateways
virtual std::string vpn_gw6() const { return std::string(); }
virtual void adjust_mss(int mss) {};
};
// Base class for parent of tun interface object, used to