Projects
Eulaceura:Factory
gazelle
_service:obs_scm:0146-udp-add-restriction-messa...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0146-udp-add-restriction-message-too-long.patch of Package gazelle
From a37c451e63bed06a70e887aba6364183d71f414f Mon Sep 17 00:00:00 2001 From: yangchen <yangchen145@huawei.com> Date: Mon, 11 Mar 2024 11:18:54 +0800 Subject: [PATCH] udp add restriction: message too long --- src/common/gazelle_opt.h | 2 ++ src/lstack/core/lstack_lwip.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/common/gazelle_opt.h b/src/common/gazelle_opt.h index 1d1c5f5..6d787b9 100644 --- a/src/common/gazelle_opt.h +++ b/src/common/gazelle_opt.h @@ -60,6 +60,8 @@ #define DPDK_PKT_BURST_SIZE 512 +#define GAZELLE_UDP_PKGLEN_MAX (65535 - IP_HLEN - UDP_HLEN) + /* total:33 client, index 32 is invaild client */ #define GAZELLE_CLIENT_NUM_ALL 33 #define GAZELLE_NULL_CLIENT (GAZELLE_CLIENT_NUM_ALL - 1) diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c index f4199f8..8aae433 100644 --- a/src/lstack/core/lstack_lwip.c +++ b/src/lstack/core/lstack_lwip.c @@ -779,6 +779,11 @@ ssize_t do_lwip_send_to_stack(int32_t fd, const void *buf, size_t len, int32_t f return 0; } + if (NETCONN_IS_UDP(sock) && (len > GAZELLE_UDP_PKGLEN_MAX)) { + LSTACK_LOG(ERR, LSTACK, "Message too long\n"); + GAZELLE_RETURN(EMSGSIZE); + } + thread_bind_stack(sock); if (sock->same_node_tx_ring != NULL) { -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2