]> git.meshlink.io Git - catta/commitdiff
regenerate wild carded service names when the host name changed
authorLennart Poettering <lennart@poettering.net>
Tue, 22 Aug 2006 01:43:51 +0000 (01:43 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 22 Aug 2006 01:43:51 +0000 (01:43 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1256 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-daemon/static-services.c

index cba22c635cccf8068c820ee42a6522ad5de1700b..4df6047d0ba475f31d8d6b11ac8183c2e33d3f08 100644 (file)
@@ -222,7 +222,9 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) {
         /* This service group is already registered in the server */
         return;
     
-    if (!g->chosen_name) {
+    if (!g->chosen_name || (g->replace_wildcards && strstr(g->name, "%h"))) {
+
+        avahi_free(g->chosen_name);
         
         if (g->replace_wildcards)
             g->chosen_name = replacestr(g->name, "%h", avahi_server_get_host_name(avahi_server));