diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-06-21 12:58:06 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-06-21 12:58:06 +0000 |
commit | 9bc2eb5311514a53243c9e771658779524e70b9a (patch) | |
tree | 33df8456ca98d69567c5659c72b9356743a0faeb /avahi-core/iface.c | |
parent | 14b64d63bc620fce2008437a874bf285ac9b8e6e (diff) |
* Update configure.ac to check for the availabilty of more functions
* really return sensible error codes from avahi_server_add_xx()
* make all users of avahi_server_add_xxx() check for the validity
* check for local RR conflicts
* only suppress local queries by remote queries if they have an empty known answer suppresion list
* fix FIONREAD call
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@136 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/iface.c')
-rw-r--r-- | avahi-core/iface.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/avahi-core/iface.c b/avahi-core/iface.c index 7972a5c..60419df 100644 --- a/avahi-core/iface.c +++ b/avahi-core/iface.c @@ -51,8 +51,12 @@ static void update_address_rr(AvahiInterfaceMonitor *m, AvahiInterfaceAddress *a if (!a->entry_group) { a->entry_group = avahi_entry_group_new(m->server, avahi_host_rr_entry_group_callback, NULL); - avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, a->interface->protocol, 0, NULL, &a->address); - avahi_entry_group_commit(a->entry_group); + if (avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, a->interface->protocol, 0, NULL, &a->address) < 0) { + avahi_log_warn(__FILE__": avahi_server_add_address() failed."); + avahi_entry_group_free(a->entry_group); + a->entry_group = NULL; + } else + avahi_entry_group_commit(a->entry_group); } } else { @@ -98,8 +102,12 @@ static void update_hw_interface_rr(AvahiInterfaceMonitor *m, AvahiHwInterface *h g_free(t); hw->entry_group = avahi_entry_group_new(m->server, avahi_host_rr_entry_group_callback, NULL); - avahi_server_add_service(m->server, hw->entry_group, hw->index, AF_UNSPEC, "_workstation._tcp", name, NULL, NULL, 9, NULL); - avahi_entry_group_commit(hw->entry_group); + if (avahi_server_add_service(m->server, hw->entry_group, hw->index, AF_UNSPEC, "_workstation._tcp", name, NULL, NULL, 9, NULL) < 0) { + avahi_log_warn(__FILE__": avahi_server_add_service() failed."); + avahi_entry_group_free(hw->entry_group); + hw->entry_group = NULL; + } else + avahi_entry_group_commit(hw->entry_group); g_free(name); } |