diff options
author | Federico Lucifredi <flucifredi@acm.org> | 2007-12-25 23:50:32 +0000 |
---|---|---|
committer | Federico Lucifredi <flucifredi@acm.org> | 2007-12-25 23:50:32 +0000 |
commit | b1adc4587692d08218a764ba8252f74d7afe12e2 (patch) | |
tree | 5759fd5895171d7893d741f1448cad1c3dea2d97 /avahi-core/wide-area.c | |
parent | 96249cf8001158f574efa25bd6860dd7c0b1b72e (diff) |
building wire-format packet.
git-svn-id: file:///home/lennart/svn/public/avahi/branches/federico@1625 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/wide-area.c')
-rw-r--r-- | avahi-core/wide-area.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c index 40cca61..2f45b06 100644 --- a/avahi-core/wide-area.c +++ b/avahi-core/wide-area.c @@ -784,9 +784,25 @@ void wide_area_publish(AvahiRecord *r, char *zone, uint16_t id) { AvahiKey *k; p = avahi_dns_packet_new_update(0); /* TODO: revisit MTU */ + if (!p) { /*OOM check */ + avahi_log_error("avahi_dns_packet_new_update() failed."); + assert(); + } avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_ID, id); + /*zone to be updated */ k = avahi_key_new(zone, AVAHI_DNS_CLASS_ANY, AVAHI_DNS_TYPE_SOA); + if (!k) { /*OOM check */ + avahi_log_error("avahi_key_new() failed."); + assert(); + } + + p = avahi_dns_packet_append_key(p, k, 0); + + if (!p) { /*OOM check */ + avahi_log_error("appending of rdata failed."); + assert(); + } }
\ No newline at end of file |