summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-31 21:06:00 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-31 08:56:03 -0400
commit946c70944ebdf428ffeb9991a7449edbd4011461 (patch)
tree8c684c2c65c4e2fcaa8d9a4b46faa70d733860ba /src/resolve/resolved-dns-packet.c
parentb93312f5960b276bae915906ccde36f545bae3e0 (diff)
resolved: MX records
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r--src/resolve/resolved-dns-packet.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index 3e6c9a480b..217bdafcb8 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -549,6 +549,13 @@ int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, size_t *star
break;
case DNS_TYPE_MX:
+ r = dns_packet_append_uint16(p, rr->mx.priority, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_append_name(p, rr->mx.exchange, NULL);
+ break;
+
case DNS_TYPE_TXT:
case DNS_TYPE_SRV:
case DNS_TYPE_DNAME:
@@ -951,6 +958,13 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) {
break;
case DNS_TYPE_MX:
+ r = dns_packet_read_uint16(p, &rr->mx.priority, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_read_name(p, &rr->mx.exchange, NULL);
+ break;
+
case DNS_TYPE_TXT:
case DNS_TYPE_SRV:
case DNS_TYPE_DNAME: