Skip to content

net: mdns increase buf size #89338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions subsys/net/lib/dns/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ config MDNS_RESPONDER

if MDNS_RESPONDER

config MDNS_RESOLVER_BUF_SIZE
int "Size of the net_buf pool buffers"
default 512
help
For larger DNS SD TXT records and long service instance names, bigger buffers are necessary

config MDNS_RESPONDER_TTL
int "Time-to-Live of returned DNS name"
default 600
Expand Down
5 changes: 3 additions & 2 deletions subsys/net/lib/dns/mdns_responder.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ static int setup_dst_addr(int sock, sa_family_t family,
#define DNS_RESOLVER_BUF_CTR (DNS_RESOLVER_MIN_BUF + \
CONFIG_MDNS_RESOLVER_ADDITIONAL_BUF_CTR)

#define MDNS_RESOLVER_BUF_SIZE CONFIG_MDNS_RESOLVER_BUF_SIZE
NET_BUF_POOL_DEFINE(mdns_msg_pool, DNS_RESOLVER_BUF_CTR,
DNS_RESOLVER_MAX_BUF_SIZE, 0, NULL);
MDNS_RESOLVER_BUF_SIZE, 0, NULL);

static void create_ipv6_addr(struct sockaddr_in6 *addr)
{
Expand Down Expand Up @@ -595,7 +596,7 @@ static int dns_read(int sock,
int queries;
int ret;

data_len = MIN(len, DNS_RESOLVER_MAX_BUF_SIZE);
data_len = MIN(len, MDNS_RESOLVER_BUF_SIZE);

/* Store the DNS query name into a temporary net_buf, which will be
* eventually used to send a response
Expand Down
Loading