mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
resolved: add support for linked packets
For mDNS, we need to support the TC bit in case the list of known answers exceed the maximum packet size. For this, add a 'more' pointer to DnsPacket for an additional packet. When a packet is unref'ed, the ->more packet is also unrefed, so it sufficient to only keep track of the 1st packet in a chain.
This commit is contained in:
parent
dbfbb6e776
commit
9c49156383
@ -170,6 +170,9 @@ DnsPacket *dns_packet_unref(DnsPacket *p) {
|
||||
|
||||
assert(p->n_ref > 0);
|
||||
|
||||
if (p->more)
|
||||
dns_packet_unref(p->more);
|
||||
|
||||
if (p->n_ref == 1)
|
||||
dns_packet_free(p);
|
||||
else
|
||||
|
@ -88,6 +88,9 @@ struct DnsPacket {
|
||||
uint16_t sender_port, destination_port;
|
||||
uint32_t ttl;
|
||||
|
||||
/* For support of truncated packets */
|
||||
DnsPacket *more;
|
||||
|
||||
bool on_stack:1;
|
||||
bool extracted:1;
|
||||
bool refuse_compression:1;
|
||||
|
Loading…
Reference in New Issue
Block a user