1 /*
2  * Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2005, 2008, 2009, 2010,
3  *               2011, 2012, 2013, 2014, 2019
4  *      Inferno Nettverk A/S, Norway.  All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. The above copyright notice, this list of conditions and the following
10  *    disclaimer must appear in all copies of the software, derivative works
11  *    or modified versions, and any portions thereof, aswell as in all
12  *    supporting documentation.
13  * 2. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *      This product includes software developed by
16  *      Inferno Nettverk A/S, Norway.
17  * 3. The name of the author may not be used to endorse or promote products
18  *    derived from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  * Inferno Nettverk A/S requests users of this software to return to
32  *
33  *  Software Distribution Coordinator  or  sdc@inet.no
34  *  Inferno Nettverk A/S
35  *  Oslo Research Park
36  *  Gaustadall�en 21
37  *  NO-0349 Oslo
38  *  Norway
39  *
40  * any improvements or extensions that they make and grant Inferno Nettverk A/S
41  * the rights to redistribute these changes.
42  *
43  */
44 
45 #include "common.h"
46 
47 static const char rcsid[] =
48 "$Id: showconfig.c,v 1.34.4.3.6.2 2020/11/11 16:11:54 karls Exp $";
49 
50 void
showtimeout(timeout)51 showtimeout(timeout)
52    const timeout_t *timeout;
53 {
54 
55    slog(LOG_DEBUG, "connect timeout: %lds%s",
56         (long)timeout->connect,
57         timeout->connect == 0 ? " (use kernel default)": "");
58 
59 #if !SOCKS_CLIENT
60    slog(LOG_DEBUG, "negotiate timeout: %lds%s",
61         (long)timeout->negotiate,
62         timeout->negotiate == 0 ? " (use kernel default)" : "");
63 
64    slog(LOG_DEBUG, "i/o timeout: tcp: %lds, udp: %lds",
65                    (long)timeout->tcpio, (long)timeout->udpio);
66 
67    slog(LOG_DEBUG, "tcp fin-wait-2 timeout: %lds%s",
68         (long)timeout->tcp_fin_wait,
69         timeout->tcp_fin_wait == 0 ? " (use kernel default)" : "");
70 #endif /* !SOCKS_CLIENT */
71 
72 }
73 
74 void
showstate(state)75 showstate(state)
76    const serverstate_t *state;
77 {
78    char buf[1024];
79    size_t bufused;
80 
81    slog(LOG_DEBUG, "command(s): %s",
82         commands2string(&state->command, buf, sizeof(buf)));
83 
84    bufused = snprintf(buf, sizeof(buf), "extension(s): ");
85    if (state->extension.bind)
86       snprintf(&buf[bufused], sizeof(buf) - bufused, "bind");
87    slog(LOG_DEBUG, "%s", buf);
88 
89    bufused = snprintf(buf, sizeof(buf), "protocol(s): ");
90    protocols2string(&state->protocol,
91    &buf[bufused], sizeof(buf) - bufused);
92    slog(LOG_DEBUG, "%s", buf);
93 
94    showmethod(object_crule, state->cmethodc, state->cmethodv);
95    showmethod(object_srule, state->smethodc, state->smethodv);
96 
97    slog(LOG_DEBUG, "proxyprotocol(s): %s",
98    proxyprotocols2string(&state->proxyprotocol, buf, sizeof(buf)));
99 
100 #if HAVE_GSSAPI
101    if (methodisset(AUTHMETHOD_GSSAPI, state->smethodv, state->smethodc)) {
102       if (*state->gssapiservicename != NUL)
103          slog(LOG_DEBUG, "gssapi.servicename: %s", state->gssapiservicename);
104 
105       if (*state->gssapikeytab != NUL)
106          slog(LOG_DEBUG, "gssapi.keytab: %s", state->gssapikeytab);
107 
108       if (state->gssapiencryption.clear
109       ||  state->gssapiencryption.integrity
110       ||  state->gssapiencryption.confidentiality
111       || state->gssapiencryption.permessage)
112          slog(LOG_DEBUG, "gssapi.encryption:%s%s%s%s",
113          state->gssapiencryption.clear?           " clear"           :"",
114          state->gssapiencryption.integrity?       " integrity"       :"",
115          state->gssapiencryption.confidentiality? " confidentiality" :"",
116          state->gssapiencryption.permessage?      " permessage"      :"");
117 
118       if (state->gssapiencryption.nec)
119          slog(LOG_DEBUG, "clientcompatibility: necgssapi enabled");
120    }
121 #endif /* HAVE_GSSAPI */
122 }
123 
124 void
showmethod(type,methodc,methodv)125 showmethod(type, methodc, methodv)
126    objecttype_t type;
127    size_t methodc;
128    const int *methodv;
129 {
130    char buf[1024];
131 
132    slog(LOG_DEBUG, "%s(s): %s",
133         type == object_crule ? "clientmethod" : "socksmethod",
134         methods2string(methodc, methodv, buf, sizeof(buf)));
135 }
136 
137 void
showconfig(sockscf)138 showconfig(sockscf)
139    const struct config *sockscf;
140 {
141 #if !SOCKS_CLIENT
142    static int firsttime = 1;
143    size_t bufused;
144 #if HAVE_SCHED_SETAFFINITY
145    size_t setsize;
146 #endif /* HAVE_SCHED_SETAFFINITY */
147 #endif /* !SOCKS_CLIENT */
148 
149    char buf[4096];
150    size_t i;
151 
152 #if !SOCKS_CLIENT
153    slog(LOG_DEBUG, "cmdline options:\n%s",
154         options2string(&sockscf->option, "", buf, sizeof(buf)));
155 
156    if (sockscf->child.maxrequests != 0)
157       slog(LOG_DEBUG, "max requests for a child to handle: %lu",
158            (unsigned long)sockscf->child.maxrequests);
159 
160    if (sockscf->child.maxlifetime != 0)
161       slog(LOG_DEBUG, "max lifetime for a child: %lu seconds",
162            (unsigned long)sockscf->child.maxlifetime);
163 
164    slog(LOG_DEBUG, "address-families to look for on internal interface: %s",
165         interfaceprotocol2string(&sockscf->internal.protocol, NULL, 0));
166 
167    slog(LOG_DEBUG, "internal addresses (%lu):",
168         (unsigned long)sockscf->internal.addrc);
169    for (i = 0; i < sockscf->internal.addrc; ++i)
170       slog(LOG_DEBUG, "\t%s %s",
171            protocol2string(sockscf->internal.addrv[i].protocol),
172            sockaddr2string2(&sockscf->internal.addrv[i].addr,
173                             ADDRINFO_ATYPE | ADDRINFO_PORT,
174                             NULL,
175                             0));
176 
177 #if HAVE_SCHED_SETSCHEDULER
178    bufused = 0;
179    if (sockscf->cpu.mother.scheduling_isset)
180       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
181                           "%s: %s/%d, ",
182                           childtype2string(PROC_MOTHER),
183                           numeric2cpupolicy(sockscf->cpu.mother.policy),
184                           sockscf->cpu.mother.param.sched_priority);
185 
186    if (sockscf->cpu.monitor.scheduling_isset)
187       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
188                           "%s: %s/%d, ",
189                           childtype2string(PROC_MONITOR),
190                           numeric2cpupolicy(sockscf->cpu.monitor.policy),
191                           sockscf->cpu.monitor.param.sched_priority);
192 
193 
194    if (sockscf->cpu.negotiate.scheduling_isset)
195       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
196                           "%s: %s/%d, ",
197                           childtype2string(PROC_NEGOTIATE),
198                           numeric2cpupolicy(sockscf->cpu.negotiate.policy),
199                           sockscf->cpu.negotiate.param.sched_priority);
200 
201    if (sockscf->cpu.request.scheduling_isset)
202       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
203                           "%s: %s/%d, ",
204                           childtype2string(PROC_REQUEST),
205                           numeric2cpupolicy(sockscf->cpu.request.policy),
206                           sockscf->cpu.request.param.sched_priority);
207 
208    if (sockscf->cpu.io.scheduling_isset)
209       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
210                           "%s: %s/%d, ",
211                           childtype2string(PROC_IO),
212                           numeric2cpupolicy(sockscf->cpu.io.policy),
213                           sockscf->cpu.io.param.sched_priority);
214 
215    if (bufused != 0)
216       slog(LOG_DEBUG, "cpu scheduling settings: %s", buf);
217 #endif /* HAVE_SCHED_SETSCHEDULER */
218 
219 #if HAVE_SCHED_SETAFFINITY
220    bufused = 0;
221    setsize = cpu_get_setsize();
222    if (sockscf->cpu.mother.affinity_isset) {
223       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused, "%s: ",
224                           childtype2string(PROC_MOTHER));
225 
226       for (i = 0; i < setsize; ++i)
227          if (cpu_isset(i, &sockscf->cpu.mother.mask))
228             bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
229                                 "%d ", (int)i);
230    }
231 
232    if (sockscf->cpu.monitor.affinity_isset) {
233       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused, "%s%s: ",
234                           bufused ? ", " : "",
235                           childtype2string(PROC_MONITOR));
236 
237       for (i = 0; i < setsize; ++i)
238          if (cpu_isset(i, &sockscf->cpu.monitor.mask))
239             bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
240                                 "%d ", (int)i);
241    }
242 
243    if (sockscf->cpu.negotiate.affinity_isset) {
244       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused, "%s%s: ",
245                           bufused ? ", " : "",
246                           childtype2string(PROC_NEGOTIATE));
247 
248       for (i = 0; i < setsize; ++i)
249          if (cpu_isset(i, &sockscf->cpu.negotiate.mask))
250             bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
251                                 "%d ", (int)i);
252    }
253 
254    if (sockscf->cpu.request.affinity_isset) {
255       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused, "%s%s: ",
256                           bufused ? ", " : "",
257                           childtype2string(PROC_REQUEST));
258 
259       for (i = 0; i < setsize; ++i)
260          if (cpu_isset(i, &sockscf->cpu.request.mask))
261             bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
262                                 "%d ", (int)i);
263    }
264 
265    if (sockscf->cpu.io.affinity_isset) {
266       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused, "%s%s: ",
267                           bufused ? ", " : "",
268                           childtype2string(PROC_IO));
269 
270       for (i = 0; i < setsize; ++i)
271          if (cpu_isset(i, &sockscf->cpu.io.mask))
272             bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
273                                 "%d ", (int)i);
274    }
275 
276    if (bufused != 0)
277       slog(LOG_DEBUG, "cpu affinity settings: %s", buf);
278 #endif /* HAVE_SCHED_SETAFFINITY */
279 
280    slog(LOG_DEBUG, "global socket options on the internal side:");
281    for (i = 0; i < sockscf->socketoptionc; ++i)
282       if (sockscf->socketoptionv[i].isinternalside)
283          slog(LOG_DEBUG, "   option #%lu: %s, value %s\n",
284               (unsigned long)i,
285               sockopt2string(&sockscf->socketoptionv[i], NULL, 0),
286               sockoptval2string(sockscf->socketoptionv[i].optval,
287                                 sockscf->socketoptionv[i].opttype,
288                                 NULL,
289                                 0));
290 
291 
292    slog(LOG_DEBUG, "address-families to look for on external interface: %s",
293         interfaceprotocol2string(&sockscf->external.protocol, NULL, 0));
294 
295    slog(LOG_DEBUG, "external addresses (%lu):",
296         (unsigned long)sockscf->external.addrc);
297    for (i = 0; i < sockscf->external.addrc; ++i) {
298       slog(LOG_DEBUG, "\t%s",
299            ruleaddr2string(&sockscf->external.addrv[i],
300                            ADDRINFO_ATYPE,
301                            NULL,
302                            0));
303    }
304 
305    slog(LOG_DEBUG, "\thave IPv4 on external address list?  %s.  IPv6?  %s",
306         external_has_safamily(AF_INET)  ? "Yes" : "No",
307         external_has_safamily(AF_INET6) ?
308                external_has_global_safamily(AF_INET6) ?
309                   "Yes (global)" : "Yes (local only)"
310             :  "No");
311 
312    slog(LOG_DEBUG, "global socket options on the external side:");
313    for (i = 0; i < sockscf->socketoptionc; ++i)
314       if (!sockscf->socketoptionv[i].isinternalside)
315          slog(LOG_DEBUG, "   option #%lu: %s, value %s\n",
316               (unsigned long)i,
317               sockopt2string(&sockscf->socketoptionv[i], NULL, 0),
318               sockoptval2string(sockscf->socketoptionv[i].optval,
319                                 sockscf->socketoptionv[i].opttype, NULL, 0));
320 
321    slog(LOG_DEBUG, "external address rotation: %s",
322         rotation2string(sockscf->external.rotation));
323 
324    slog(LOG_DEBUG, "compatibility options: %s",
325         compats2string(&sockscf->compat, buf, sizeof(buf)));
326 
327    slog(LOG_DEBUG, "extensions enabled: %s",
328         extensions2string(&sockscf->extension, buf, sizeof(buf)));
329 
330    slog(LOG_DEBUG, "connect udp sockets to destination: %s",
331         sockscf->udpconnectdst ? "yes" : "no");
332 
333    showlogspecial(&sockscf->internal.log, INTERNALIF);
334    showlogspecial(&sockscf->external.log, EXTERNALIF);
335 
336 #endif /* !SOCKS_CLIENT */
337 
338    slog(LOG_DEBUG, "logoutput goes to: %s",
339         logtypes2string(&sockscf->log, buf, sizeof(buf)));
340 
341    slog(LOG_DEBUG, "resolveprotocol: %s",
342         resolveprotocol2string(sockscf->resolveprotocol));
343 
344    showtimeout(&sockscf->timeout);
345 
346    slog(LOG_DEBUG, "global route options: %s",
347         routeoptions2string(&sockscf->routeoptions, buf, sizeof(buf)));
348 
349    slog(LOG_DEBUG, "direct route fallback: %s",
350         sockscf->option.directfallback ? "enabled" : "disabled");
351 
352 #if !SOCKS_CLIENT
353    srchosts2string(&sockscf->srchost, "", buf, sizeof(buf));
354    if (*buf != NUL)
355       slog(LOG_DEBUG, "srchost:\n%s", buf);
356 
357 #if COVENANT
358    slog(LOG_DEBUG, "proxy realm: %s", sockscf->realmname);
359 #endif /* COVENANT */
360 
361 #if HAVE_LIBWRAP
362    if (sockscf->option.hosts_access)
363       slog(LOG_DEBUG, "libwrap.hosts_access: yes");
364    else
365       slog(LOG_DEBUG, "libwrap.hosts_access: no");
366 #endif /* HAVE_LIBWRAP */
367 
368 #if !HAVE_PRIVILEGES
369    slog(LOG_DEBUG, "euid: %d", (int)sockscf->initial.euid);
370 
371    slog(LOG_DEBUG, "userid:\n%s",
372         userids2string(&sockscf->uid, "", buf, sizeof(buf)));
373 #endif /* !HAVE_PRIVILEGES */
374 
375    bufused = snprintf(buf, sizeof(buf), "clientmethod(s): ");
376    for (i = 0; (size_t)i < sockscf->cmethodc; ++i)
377       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused, "%s%s",
378       i > 0 ? ", " : "", method2string(sockscf->cmethodv[i]));
379 
380    slog(LOG_DEBUG, "%s", buf);
381 
382    bufused = snprintf(buf, sizeof(buf), "socksmethod(s): ");
383    for (i = 0; (size_t)i < sockscf->smethodc; ++i)
384       bufused += snprintf(&buf[bufused], sizeof(buf) - bufused,
385                          "%s%s",
386                          i > 0 ? ", " : "",
387                          method2string(sockscf->smethodv[i]));
388 
389    slog(LOG_DEBUG, "%s", buf);
390 
391 #endif /* !SOCKS_CLIENT */
392 
393 
394    if (sockscf->option.debug) {
395       route_t *route;
396 #if !SOCKS_CLIENT
397       rule_t *rule;
398       monitor_t *monitor;
399 
400       for (i = 0, rule = sockscf->crule; rule != NULL; rule = rule->next)
401          ++i;
402       slog(LOG_DEBUG, "%ss (%lu): ",
403            objecttype2string(object_crule), (unsigned long)i);
404 
405       for (rule = sockscf->crule; rule != NULL; rule = rule->next)
406          showrule(rule, object_crule);
407 
408 #if HAVE_SOCKS_HOSTID
409       for (i = 0, rule = sockscf->hrule; rule != NULL; rule = rule->next)
410          ++i;
411       slog(LOG_DEBUG, "%ss (%lu): ",
412            objecttype2string(object_hrule), (unsigned long)i);
413 
414       for (rule = sockscf->hrule; rule != NULL; rule = rule->next)
415          showrule(rule, object_hrule);
416 #endif /* HAVE_SOCKS_HOSTID */
417 
418       for (i = 0, rule = sockscf->srule; rule != NULL; rule = rule->next)
419          ++i;
420       slog(LOG_DEBUG, "%ss (%lu): ",
421            objecttype2string(object_srule), (unsigned long)i);
422 
423       for (rule = sockscf->srule; rule != NULL; rule = rule->next)
424          showrule(rule, object_srule);
425 #endif /* !SOCKS_CLIENT */
426 
427       for (i = 0, route = sockscf->route; route != NULL; route = route->next)
428          ++i;
429       slog(LOG_DEBUG, "routes (%lu): ", (unsigned long)i);
430       for (route = sockscf->route; route != NULL; route = route->next)
431          socks_showroute(route);
432 
433 #if !SOCKS_CLIENT
434       for (i = 0, monitor = sockscf->monitor;
435            monitor != NULL;
436            monitor = monitor->next)
437               ++i;
438 
439       slog(LOG_DEBUG, "monitors (%lu): ", (unsigned long)i);
440       for (monitor = sockscf->monitor; monitor != NULL; monitor = monitor->next)
441          showmonitor(monitor);
442 #endif /* !SOCKS_CLIENT */
443 
444    }
445 
446 #if !SOCKS_CLIENT
447    if (firsttime) {
448       slog(LOG_DEBUG, "shmemconfigfd: %d, hostfd: %d, "
449 #if HAVE_LDAP
450                       "ldapfd: %d, "
451 #endif /* HAVE_LDAP */
452                       "loglock: %d, shmemfd: %d, ",
453                       sockscf->shmemconfigfd,
454                       sockscf->hostfd,
455 #if HAVE_LDAP
456                       sockscf->ldapfd,
457 #endif /* HAVE_LDAP */
458                       sockscf->loglock,
459                       sockscf->shmemfd);
460 
461       firsttime = 0;
462    }
463 #endif /* !SOCKS_CLIENT */
464 }
465 
466 void
socks_showroute(route)467 socks_showroute(route)
468    const route_t *route;
469 {
470    char gwstring[MAXGWSTRING], addr[MAXRULEADDRSTRING];
471    size_t i;
472 
473    slog(LOG_DEBUG, "route #%d", route->number);
474 
475    slog(LOG_DEBUG, "src: %s",
476         ruleaddr2string(&route->src, ADDRINFO_PORT, addr, sizeof(addr)));
477 
478    slog(LOG_DEBUG, "dst: %s",
479         ruleaddr2string(&route->dst, ADDRINFO_PORT, addr, sizeof(addr)));
480 
481    slog(LOG_DEBUG, "gateway: %s",
482         sockshost2string(&route->gw.addr, gwstring, sizeof(gwstring)));
483 
484    showstate(&route->gw.state);
485 
486    if (route->rdr_from.atype != SOCKS_ADDR_NOTSET)
487       slog(LOG_DEBUG, "redirect from: %s",
488           ruleaddr2string(&route->rdr_from, ADDRINFO_PORT, addr, sizeof(addr)));
489 
490    for (i = 0; i < route->socketoptionc; ++i)
491       slog(LOG_DEBUG, "socketoption %s", route->socketoptionv[i].info->name);
492 
493    slog(LOG_DEBUG, "route state: autoadded: %s, failed: %lu, badtime: %ld",
494                    route->state.autoadded ? "yes" : "no",
495                    (long)route->state.failed,
496                    (long)route->state.badtime);
497 }
498 
499 #if !SOCKS_CLIENT
500 
501 void
showlogspecial(log,side)502 showlogspecial(log, side)
503    const logspecial_t *log;
504    const interfaceside_t side;
505 {
506    size_t i;
507 
508    if (log->protocol.tcp.disabled.isconfigured) {
509       slog(LOG_DEBUG,
510            "warn if the following %s options are not enabled on the %s side: "
511            "ECN: %swarning, SACK: %swarning, TIMESTAMPS: %swarning, "
512            "WSCALE: %swarning",
513            protocol2string(SOCKS_TCP),
514            interfaceside2string(side),
515            log->protocol.tcp.disabled.ecn        ? "" : "no ",
516            log->protocol.tcp.disabled.sack       ? "" : "no ",
517            log->protocol.tcp.disabled.timestamps ? "" : "no ",
518            log->protocol.tcp.disabled.wscale     ? "" : "no ");
519    }
520 
521    if (log->protocol.tcp.enabled.isconfigured) {
522       slog(LOG_DEBUG,
523            "warn if the following %s options are enabled on the %s side: "
524            "ECN: %swarning, SACK: %swarning, TIMESTAMPS: %swarning, "
525            "WSCALE: %swarning",
526            protocol2string(SOCKS_TCP),
527            interfaceside2string(side),
528            log->protocol.tcp.enabled.ecn        ? "" : "no ",
529            log->protocol.tcp.enabled.sack       ? "" : "no ",
530            log->protocol.tcp.enabled.timestamps ? "" : "no ",
531            log->protocol.tcp.enabled.wscale     ? "" : "no ");
532    }
533 
534    for (i = 0; i < ELEMENTS(log->errno_loglevelv); ++i) {
535       if (log->errno_loglevelc[i] > 0) {
536          size_t ii;
537 
538          slog(LOG_DEBUG,
539               "extra errno values on the %s side for loglevel %s (%lu):",
540               interfaceside2string(side),
541               loglevel2string(i), (unsigned long)i);
542 
543          for (ii = 0; ii < log->errno_loglevelc[i]; ++ii)
544             slog(LOG_DEBUG, "%d", log->errno_loglevelv[i][ii]);
545       }
546    }
547 
548    for (i = 0; i < ELEMENTS(log->gaierr_loglevelv); ++i) {
549       if (log->gaierr_loglevelc[i] > 0) {
550          size_t ii;
551 
552          slog(LOG_DEBUG,
553               "extra dnserror values on the %s side for loglevel %s (%lu):",
554               interfaceside2string(side),
555               loglevel2string(i),
556               (unsigned long)i);
557 
558          for (ii = 0; ii < log->gaierr_loglevelc[i]; ++ii)
559             slog(LOG_DEBUG, "%d", log->gaierr_loglevelv[i][ii]);
560       }
561    }
562 
563 }
564 
565 #endif /* !SOCKS_CLIENT */
566