-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
base: main
Are you sure you want to change the base?
net: mdns increase buf size #89338
Conversation
subsys/net/lib/dns/mdns_responder.c
Outdated
@@ -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_MAX_BUF_SIZE 1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you introduce a Kconfig symbol for this, perhaps defaulting the previous default. This way it is easier to adjust the value according to the user needs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done
d3e166a
to
22760fa
Compare
subsys/net/lib/dns/mdns_responder.c
Outdated
@@ -116,7 +116,7 @@ static int setup_dst_addr(int sock, sa_family_t family, | |||
CONFIG_MDNS_RESOLVER_ADDITIONAL_BUF_CTR) | |||
|
|||
NET_BUF_POOL_DEFINE(mdns_msg_pool, DNS_RESOLVER_BUF_CTR, | |||
DNS_RESOLVER_MAX_BUF_SIZE, 0, NULL); | |||
CONFIG_MDNS_RESOLVER_BUF_SIZE, 0, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not enough to change this line only because the buffer size is also used in dns_read()
.
If we only want to use this extra size for mDNS, then we could do something like this:
diff --git a/subsys/net/lib/dns/mdns_responder.c b/subsys/net/lib/dns/mdns_responder.c
index 29f1c657ae1..0ddc08ebb56 100644
--- a/subsys/net/lib/dns/mdns_responder.c
+++ b/subsys/net/lib/dns/mdns_responder.c
@@ -115,8 +115,10 @@ 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_MAX_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_MAX_BUF_SIZE, 0, NULL);
static void create_ipv6_addr(struct sockaddr_in6 *addr)
{
@@ -595,7 +597,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_MAX_BUF_SIZE);
/* Store the DNS query name into a temporary net_buf, which will be
* eventually used to send a response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
22760fa
to
21185ae
Compare
subsys/net/lib/dns/mdns_responder.c
Outdated
NET_BUF_POOL_DEFINE(mdns_msg_pool, DNS_RESOLVER_BUF_CTR, | ||
DNS_RESOLVER_MAX_BUF_SIZE, 0, NULL); | ||
MDNS_RESOLVER_BUF_SIZE, 0, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please stick to the orignal alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
for longer DNS-SD text records and instance names we need a bigger buffer Signed-off-by: Toon Stegen <toon@toostsolutions.be>
21185ae
to
3e0fe5a
Compare
|
for longer DNS-SD text records and instance names we need a bigger buffer