Skip to content

Commit

Permalink
Get master changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zdohnal committed Feb 29, 2024
1 parent 475dbff commit 26ba2ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pappl/dnssd.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ _papplPrinterRegisterDNSSDNoLock(
papplLogPrinter(printer, PAPPL_LOGLEVEL_DEBUG, "Registering DNS-SD name '%s' on '%s'", printer->dns_sd_name, printer->system->reghost);

# ifdef HAVE_MDNSRESPONDER
if_index = !strcmp(system->reghost, "localhost") ? kDNSServiceInterfaceIndexLocalOnly : kDNSServiceInterfaceIndexAny;
if_index = !strcasecmp(system->reghost, "localhost") ? kDNSServiceInterfaceIndexLocalOnly : kDNSServiceInterfaceIndexAny;
# else
if_index = !strcmp(system->reghost, "localhost") ? if_nametoindex("lo") : AVAHI_IF_UNSPEC;
if_index = !strcasecmp(system->reghost, "localhost") ? if_nametoindex("lo") : AVAHI_IF_UNSPEC;
# endif // HAVE_MDNSRESPONDER

// Get attributes and values for the TXT record...
Expand Down Expand Up @@ -951,9 +951,9 @@ _papplSystemRegisterDNSSDNoLock(
papplLog(system, PAPPL_LOGLEVEL_DEBUG, "Registering DNS-SD name '%s' on '%s'", system->dns_sd_name, system->hostname);

# ifdef HAVE_MDNSRESPONDER
if_index = !strcmp(system->reghost, "localhost") ? kDNSServiceInterfaceIndexLocalOnly : kDNSServiceInterfaceIndexAny;
if_index = !strcasecmp(system->reghost, "localhost") ? kDNSServiceInterfaceIndexLocalOnly : kDNSServiceInterfaceIndexAny;
# else
if_index = !strcmp(system->reghost, "localhost") ? if_nametoindex("lo") : AVAHI_IF_UNSPEC;
if_index = !strcasecmp(system->reghost, "localhost") ? if_nametoindex("lo") : AVAHI_IF_UNSPEC;
# endif // HAVE_MDNSRESPONDER

if (system->geo_location)
Expand Down
6 changes: 4 additions & 2 deletions pappl/system-accessors.c
Original file line number Diff line number Diff line change
Expand Up @@ -1904,9 +1904,11 @@ _papplSystemSetHostNameNoLock(
system->hostname = strdup(value);

// Update registration hostname as well if it is not localhost
if (system->reghost && strcmp(system->reghost, "localhost"))
if (!system->reghost || strcasecmp(system->reghost, "localhost"))
{
free(system->reghost);
if (system->reghost)
free(system->reghost);

system->reghost = strdup(value);
}

Expand Down
1 change: 0 additions & 1 deletion pappl/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ papplSystemCreate(

// Make sure the system name, registration name and UUID are initialized...
papplSystemSetHostName(system, NULL);
papplSystemSetRegHostName(system, NULL);
papplSystemSetUUID(system, NULL);

// See if the spool directory can be created...
Expand Down
1 change: 0 additions & 1 deletion testsuite/testmainloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ system_cb(int num_options, // I - Number of options

papplSystemAddListeners(system, NULL);
papplSystemSetHostName(system, hostname);
papplSystemSetRegHostName(system, NULL);

papplSystemSetPrinterDrivers(system, (int)(sizeof(pwg_drivers) / sizeof(pwg_drivers[0])), pwg_drivers, pwg_autoadd, /*create_cb*/NULL, pwg_callback, "testmainloop");

Expand Down

0 comments on commit 26ba2ee

Please sign in to comment.