Skip to content
Commit 46a58596 authored by Benjamin Robin's avatar Benjamin Robin Committed by Zbigniew Jędrzejewski-Szmek
Browse files

resolve: Try to remove the ambiguity about the mtu parameter of dns_packet_new (#6285)

Actually the caller of dns_packet_new() pass 0 or the data size of the UDP message.
So try to reflect that, so rename the `mtu` parameter to `min_alloc_dsize`.

In fact `mtu` is the size of the whole UDP message, including the UDP header,
and here we just need to pass the size of data (without header). This was confusing.

Also add a check on the requested allocated size, since some caller do not check what is really allocated.
Indeed the function do not allocate more than DNS_PACKET_SIZE_MAX whatever the value of the `mtu` parameter.
parent 86086fce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment