Open tehfink opened 5 years ago
You can fix this by changing the value of MAXPACKET
in mdnsd/packet.c
to a larger value. I don't know the reasoning behind the current value, so I'll do some more research before submitting a PR.
diff --git i/mdnsd/packet.c w/mdnsd/packet.c
index 7472836..1a3a7db 100644
--- i/mdnsd/packet.c
+++ w/mdnsd/packet.c
@@ -51,7 +51,7 @@
#define NAMECOMP_MSK 0xc000
#define NAMEADDR_MSK ~0xc000
#define MAXLABELS 128
-#define MAXPACKET 10000
+#define MAXPACKET 65535
#define HDR_LEN 12
#define MINQRY_LEN 6 /* 4 (qtype + qclass) +1 (null) + 1 (label len) */
/* Defer truncated packets from 400ms-500ms */
Currently the functions recv_packet
and pkt_sendto
allocate the buffer on the stack using buf[MAXPACKET]
. Instead, they should be allocating the buffer based on the size of the interface MTU.
Trying to run mdnsd on FreeBSD 11.2-RELEASE-p9 with a GENERIC Kernel, in a jail mounted on the loopback interface:
Results in this error:
Changing the default
mtu
on the host works:But, now all the other jails must use the lower
mtu
setting.