mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-20 18:23:41 +00:00
Fix GSO / GRO auto detection when IPv6 is disabled.
This commit is contained in:
committed by
Benjamin Saunders
parent
fb2af0816e
commit
78401c614f
@@ -571,7 +571,9 @@ mod gso {
|
||||
pub fn max_gso_segments() -> usize {
|
||||
const GSO_SIZE: libc::c_int = 1500;
|
||||
|
||||
let socket = match std::net::UdpSocket::bind("[::]:0") {
|
||||
let socket = match std::net::UdpSocket::bind("[::]:0")
|
||||
.or_else(|_| std::net::UdpSocket::bind("127.0.0.1:0"))
|
||||
{
|
||||
Ok(socket) => socket,
|
||||
Err(_) => return 1,
|
||||
};
|
||||
@@ -618,7 +620,9 @@ mod gro {
|
||||
use super::*;
|
||||
|
||||
pub fn gro_segments() -> usize {
|
||||
let socket = match std::net::UdpSocket::bind("[::]:0") {
|
||||
let socket = match std::net::UdpSocket::bind("[::]:0")
|
||||
.or_else(|_| std::net::UdpSocket::bind("127.0.0.1:0"))
|
||||
{
|
||||
Ok(socket) => socket,
|
||||
Err(_) => return 1,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user