diff options
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/main.rs | 6 |
3 files changed, 4 insertions, 6 deletions
@@ -940,7 +940,7 @@ dependencies = [ [[package]] name = "rsdsl_pppoe" -version = "0.1.3" +version = "0.1.2" dependencies = [ "byteorder", "etherparse", @@ -1,6 +1,6 @@ [package] name = "rsdsl_pppoe" -version = "0.1.3" +version = "0.1.2" authors = ["HimbeerserverDE <himbeerserverde@gmail.com>"] license = "MIT" edition = "2021" diff --git a/src/main.rs b/src/main.rs index d062d5d..1be7d5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,6 @@ use rsdsl_pppoe::client::Client; use rsdsl_pppoe::config::Config; use rsdsl_pppoe::error::{Error, Result}; -use std::cmp::min; use std::fs::File; use std::sync::mpsc; use std::sync::{Arc, Mutex}; @@ -16,7 +15,6 @@ use rsdsl_netlinkd::link; use tun_tap::{Iface, Mode}; const IPPROTO_TCP: u8 = 0x06; -const MAX_MSS: u16 = 1452; fn prepend<T>(v: Vec<T>, s: &[T]) -> Vec<T> where @@ -42,8 +40,8 @@ fn clamp_mss_if_needed(buf: &mut [u8]) -> Result<()> { for opt in tcp_header.options_iterator() { match opt { Ok(mut opt) => { - if let TcpOptionElement::MaximumSegmentSize(mss) = opt { - opt = TcpOptionElement::MaximumSegmentSize(min(mss, MAX_MSS)); + if let TcpOptionElement::MaximumSegmentSize(_) = opt { + opt = TcpOptionElement::MaximumSegmentSize(1492); } opts.push(opt); |