irp_ho.c revision 1.1.1.1.2.2 1 1.1.1.1.2.2 jym /* $NetBSD: irp_ho.c,v 1.1.1.1.2.2 2009/05/13 18:52:11 jym Exp $ */
2 1.1.1.1.2.2 jym
3 1.1.1.1.2.2 jym /*
4 1.1.1.1.2.2 jym * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
5 1.1.1.1.2.2 jym * Portions Copyright (c) 1996,1998 by Internet Software Consortium.
6 1.1.1.1.2.2 jym *
7 1.1.1.1.2.2 jym * Permission to use, copy, modify, and distribute this software for any
8 1.1.1.1.2.2 jym * purpose with or without fee is hereby granted, provided that the above
9 1.1.1.1.2.2 jym * copyright notice and this permission notice appear in all copies.
10 1.1.1.1.2.2 jym *
11 1.1.1.1.2.2 jym * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
12 1.1.1.1.2.2 jym * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 1.1.1.1.2.2 jym * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
14 1.1.1.1.2.2 jym * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 1.1.1.1.2.2 jym * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 1.1.1.1.2.2 jym * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
17 1.1.1.1.2.2 jym * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 1.1.1.1.2.2 jym */
19 1.1.1.1.2.2 jym
20 1.1.1.1.2.2 jym #if defined(LIBC_SCCS) && !defined(lint)
21 1.1.1.1.2.2 jym static const char rcsid[] = "Id: irp_ho.c,v 1.3 2005/04/27 04:56:28 sra Exp";
22 1.1.1.1.2.2 jym #endif /* LIBC_SCCS and not lint */
23 1.1.1.1.2.2 jym
24 1.1.1.1.2.2 jym /* Imports. */
25 1.1.1.1.2.2 jym
26 1.1.1.1.2.2 jym #include "port_before.h"
27 1.1.1.1.2.2 jym
28 1.1.1.1.2.2 jym #include <syslog.h>
29 1.1.1.1.2.2 jym #include <sys/types.h>
30 1.1.1.1.2.2 jym #include <sys/param.h>
31 1.1.1.1.2.2 jym #include <sys/socket.h>
32 1.1.1.1.2.2 jym
33 1.1.1.1.2.2 jym #include <netinet/in.h>
34 1.1.1.1.2.2 jym #include <arpa/inet.h>
35 1.1.1.1.2.2 jym #include <arpa/nameser.h>
36 1.1.1.1.2.2 jym
37 1.1.1.1.2.2 jym #include <ctype.h>
38 1.1.1.1.2.2 jym #include <errno.h>
39 1.1.1.1.2.2 jym #include <fcntl.h>
40 1.1.1.1.2.2 jym #include <netdb.h>
41 1.1.1.1.2.2 jym #include <resolv.h>
42 1.1.1.1.2.2 jym #include <stdio.h>
43 1.1.1.1.2.2 jym #include <stdlib.h>
44 1.1.1.1.2.2 jym #include <string.h>
45 1.1.1.1.2.2 jym #include <syslog.h>
46 1.1.1.1.2.2 jym
47 1.1.1.1.2.2 jym #include <irs.h>
48 1.1.1.1.2.2 jym #include <irp.h>
49 1.1.1.1.2.2 jym #include <isc/irpmarshall.h>
50 1.1.1.1.2.2 jym #include <isc/memcluster.h>
51 1.1.1.1.2.2 jym
52 1.1.1.1.2.2 jym #include "irs_p.h"
53 1.1.1.1.2.2 jym #include "dns_p.h"
54 1.1.1.1.2.2 jym #include "irp_p.h"
55 1.1.1.1.2.2 jym
56 1.1.1.1.2.2 jym #include "port_after.h"
57 1.1.1.1.2.2 jym
58 1.1.1.1.2.2 jym /* Definitions. */
59 1.1.1.1.2.2 jym
60 1.1.1.1.2.2 jym #define MAXALIASES 35
61 1.1.1.1.2.2 jym #define MAXADDRS 35
62 1.1.1.1.2.2 jym #define Max(a,b) ((a) > (b) ? (a) : (b))
63 1.1.1.1.2.2 jym
64 1.1.1.1.2.2 jym
65 1.1.1.1.2.2 jym struct pvt {
66 1.1.1.1.2.2 jym struct irp_p *girpdata;
67 1.1.1.1.2.2 jym int warned;
68 1.1.1.1.2.2 jym struct hostent host;
69 1.1.1.1.2.2 jym };
70 1.1.1.1.2.2 jym
71 1.1.1.1.2.2 jym /* Forward. */
72 1.1.1.1.2.2 jym
73 1.1.1.1.2.2 jym static void ho_close(struct irs_ho *this);
74 1.1.1.1.2.2 jym static struct hostent * ho_byname(struct irs_ho *this, const char *name);
75 1.1.1.1.2.2 jym static struct hostent * ho_byname2(struct irs_ho *this, const char *name,
76 1.1.1.1.2.2 jym int af);
77 1.1.1.1.2.2 jym static struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
78 1.1.1.1.2.2 jym int len, int af);
79 1.1.1.1.2.2 jym static struct hostent * ho_next(struct irs_ho *this);
80 1.1.1.1.2.2 jym static void ho_rewind(struct irs_ho *this);
81 1.1.1.1.2.2 jym static void ho_minimize(struct irs_ho *this);
82 1.1.1.1.2.2 jym
83 1.1.1.1.2.2 jym static void free_host(struct hostent *ho);
84 1.1.1.1.2.2 jym static struct addrinfo * ho_addrinfo(struct irs_ho *this, const char *name,
85 1.1.1.1.2.2 jym const struct addrinfo *pai);
86 1.1.1.1.2.2 jym
87 1.1.1.1.2.2 jym /* Public. */
88 1.1.1.1.2.2 jym
89 1.1.1.1.2.2 jym /*%
90 1.1.1.1.2.2 jym * struct irs_ho * irs_irp_ho(struct irs_acc *this)
91 1.1.1.1.2.2 jym *
92 1.1.1.1.2.2 jym * Notes:
93 1.1.1.1.2.2 jym *
94 1.1.1.1.2.2 jym * Initializes the irp_ho module.
95 1.1.1.1.2.2 jym *
96 1.1.1.1.2.2 jym */
97 1.1.1.1.2.2 jym
98 1.1.1.1.2.2 jym struct irs_ho *
99 1.1.1.1.2.2 jym irs_irp_ho(struct irs_acc *this) {
100 1.1.1.1.2.2 jym struct irs_ho *ho;
101 1.1.1.1.2.2 jym struct pvt *pvt;
102 1.1.1.1.2.2 jym
103 1.1.1.1.2.2 jym if (!(ho = memget(sizeof *ho))) {
104 1.1.1.1.2.2 jym errno = ENOMEM;
105 1.1.1.1.2.2 jym return (NULL);
106 1.1.1.1.2.2 jym }
107 1.1.1.1.2.2 jym memset(ho, 0x0, sizeof *ho);
108 1.1.1.1.2.2 jym
109 1.1.1.1.2.2 jym if (!(pvt = memget(sizeof *pvt))) {
110 1.1.1.1.2.2 jym memput(ho, sizeof *ho);
111 1.1.1.1.2.2 jym errno = ENOMEM;
112 1.1.1.1.2.2 jym return (NULL);
113 1.1.1.1.2.2 jym }
114 1.1.1.1.2.2 jym memset(pvt, 0, sizeof *pvt);
115 1.1.1.1.2.2 jym pvt->girpdata = this->private;
116 1.1.1.1.2.2 jym
117 1.1.1.1.2.2 jym ho->private = pvt;
118 1.1.1.1.2.2 jym ho->close = ho_close;
119 1.1.1.1.2.2 jym ho->byname = ho_byname;
120 1.1.1.1.2.2 jym ho->byname2 = ho_byname2;
121 1.1.1.1.2.2 jym ho->byaddr = ho_byaddr;
122 1.1.1.1.2.2 jym ho->next = ho_next;
123 1.1.1.1.2.2 jym ho->rewind = ho_rewind;
124 1.1.1.1.2.2 jym ho->minimize = ho_minimize;
125 1.1.1.1.2.2 jym ho->addrinfo = ho_addrinfo;
126 1.1.1.1.2.2 jym
127 1.1.1.1.2.2 jym return (ho);
128 1.1.1.1.2.2 jym }
129 1.1.1.1.2.2 jym
130 1.1.1.1.2.2 jym /* Methods. */
131 1.1.1.1.2.2 jym
132 1.1.1.1.2.2 jym /*%
133 1.1.1.1.2.2 jym * Closes down the module.
134 1.1.1.1.2.2 jym *
135 1.1.1.1.2.2 jym */
136 1.1.1.1.2.2 jym
137 1.1.1.1.2.2 jym static void
138 1.1.1.1.2.2 jym ho_close(struct irs_ho *this) {
139 1.1.1.1.2.2 jym struct pvt *pvt = (struct pvt *)this->private;
140 1.1.1.1.2.2 jym
141 1.1.1.1.2.2 jym ho_minimize(this);
142 1.1.1.1.2.2 jym
143 1.1.1.1.2.2 jym free_host(&pvt->host);
144 1.1.1.1.2.2 jym
145 1.1.1.1.2.2 jym memput(pvt, sizeof *pvt);
146 1.1.1.1.2.2 jym memput(this, sizeof *this);
147 1.1.1.1.2.2 jym }
148 1.1.1.1.2.2 jym
149 1.1.1.1.2.2 jym
150 1.1.1.1.2.2 jym
151 1.1.1.1.2.2 jym /*
152 1.1.1.1.2.2 jym * struct hostent * ho_byname(struct irs_ho *this, const char *name)
153 1.1.1.1.2.2 jym *
154 1.1.1.1.2.2 jym */
155 1.1.1.1.2.2 jym
156 1.1.1.1.2.2 jym static struct hostent *
157 1.1.1.1.2.2 jym ho_byname(struct irs_ho *this, const char *name) {
158 1.1.1.1.2.2 jym return (ho_byname2(this, name, AF_INET));
159 1.1.1.1.2.2 jym }
160 1.1.1.1.2.2 jym
161 1.1.1.1.2.2 jym
162 1.1.1.1.2.2 jym
163 1.1.1.1.2.2 jym
164 1.1.1.1.2.2 jym
165 1.1.1.1.2.2 jym /*
166 1.1.1.1.2.2 jym * struct hostent * ho_byname2(struct irs_ho *this, const char *name, int af)
167 1.1.1.1.2.2 jym *
168 1.1.1.1.2.2 jym */
169 1.1.1.1.2.2 jym
170 1.1.1.1.2.2 jym static struct hostent *
171 1.1.1.1.2.2 jym ho_byname2(struct irs_ho *this, const char *name, int af) {
172 1.1.1.1.2.2 jym struct pvt *pvt = (struct pvt *)this->private;
173 1.1.1.1.2.2 jym struct hostent *ho = &pvt->host;
174 1.1.1.1.2.2 jym char *body = NULL;
175 1.1.1.1.2.2 jym size_t bodylen;
176 1.1.1.1.2.2 jym int code;
177 1.1.1.1.2.2 jym char text[256];
178 1.1.1.1.2.2 jym
179 1.1.1.1.2.2 jym if (ho->h_name != NULL &&
180 1.1.1.1.2.2 jym strcmp(name, ho->h_name) == 0 &&
181 1.1.1.1.2.2 jym af == ho->h_addrtype) {
182 1.1.1.1.2.2 jym return (ho);
183 1.1.1.1.2.2 jym }
184 1.1.1.1.2.2 jym
185 1.1.1.1.2.2 jym if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
186 1.1.1.1.2.2 jym return (NULL);
187 1.1.1.1.2.2 jym }
188 1.1.1.1.2.2 jym
189 1.1.1.1.2.2 jym if (irs_irp_send_command(pvt->girpdata, "gethostbyname2 %s %s",
190 1.1.1.1.2.2 jym name, ADDR_T_STR(af)) != 0)
191 1.1.1.1.2.2 jym return (NULL);
192 1.1.1.1.2.2 jym
193 1.1.1.1.2.2 jym if (irs_irp_get_full_response(pvt->girpdata, &code,
194 1.1.1.1.2.2 jym text, sizeof text,
195 1.1.1.1.2.2 jym &body, &bodylen) != 0) {
196 1.1.1.1.2.2 jym return (NULL);
197 1.1.1.1.2.2 jym }
198 1.1.1.1.2.2 jym
199 1.1.1.1.2.2 jym if (code == IRPD_GETHOST_OK) {
200 1.1.1.1.2.2 jym free_host(ho);
201 1.1.1.1.2.2 jym if (irp_unmarshall_ho(ho, body) != 0) {
202 1.1.1.1.2.2 jym ho = NULL;
203 1.1.1.1.2.2 jym }
204 1.1.1.1.2.2 jym } else {
205 1.1.1.1.2.2 jym ho = NULL;
206 1.1.1.1.2.2 jym }
207 1.1.1.1.2.2 jym
208 1.1.1.1.2.2 jym if (body != NULL) {
209 1.1.1.1.2.2 jym memput(body, bodylen);
210 1.1.1.1.2.2 jym }
211 1.1.1.1.2.2 jym
212 1.1.1.1.2.2 jym return (ho);
213 1.1.1.1.2.2 jym }
214 1.1.1.1.2.2 jym
215 1.1.1.1.2.2 jym
216 1.1.1.1.2.2 jym
217 1.1.1.1.2.2 jym /*
218 1.1.1.1.2.2 jym * struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
219 1.1.1.1.2.2 jym * int len, int af)
220 1.1.1.1.2.2 jym *
221 1.1.1.1.2.2 jym */
222 1.1.1.1.2.2 jym
223 1.1.1.1.2.2 jym static struct hostent *
224 1.1.1.1.2.2 jym ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) {
225 1.1.1.1.2.2 jym struct pvt *pvt = (struct pvt *)this->private;
226 1.1.1.1.2.2 jym struct hostent *ho = &pvt->host;
227 1.1.1.1.2.2 jym char *body = NULL;
228 1.1.1.1.2.2 jym size_t bodylen;
229 1.1.1.1.2.2 jym int code;
230 1.1.1.1.2.2 jym char **p;
231 1.1.1.1.2.2 jym char paddr[MAXPADDRSIZE];
232 1.1.1.1.2.2 jym char text[256];
233 1.1.1.1.2.2 jym
234 1.1.1.1.2.2 jym if (ho->h_name != NULL &&
235 1.1.1.1.2.2 jym af == ho->h_addrtype &&
236 1.1.1.1.2.2 jym len == ho->h_length) {
237 1.1.1.1.2.2 jym for (p = ho->h_addr_list ; *p != NULL ; p++) {
238 1.1.1.1.2.2 jym if (memcmp(*p, addr, len) == 0)
239 1.1.1.1.2.2 jym return (ho);
240 1.1.1.1.2.2 jym }
241 1.1.1.1.2.2 jym }
242 1.1.1.1.2.2 jym
243 1.1.1.1.2.2 jym if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
244 1.1.1.1.2.2 jym return (NULL);
245 1.1.1.1.2.2 jym }
246 1.1.1.1.2.2 jym
247 1.1.1.1.2.2 jym if (inet_ntop(af, addr, paddr, sizeof paddr) == NULL) {
248 1.1.1.1.2.2 jym return (NULL);
249 1.1.1.1.2.2 jym }
250 1.1.1.1.2.2 jym
251 1.1.1.1.2.2 jym if (irs_irp_send_command(pvt->girpdata, "gethostbyaddr %s %s",
252 1.1.1.1.2.2 jym paddr, ADDR_T_STR(af)) != 0) {
253 1.1.1.1.2.2 jym return (NULL);
254 1.1.1.1.2.2 jym }
255 1.1.1.1.2.2 jym
256 1.1.1.1.2.2 jym if (irs_irp_get_full_response(pvt->girpdata, &code,
257 1.1.1.1.2.2 jym text, sizeof text,
258 1.1.1.1.2.2 jym &body, &bodylen) != 0) {
259 1.1.1.1.2.2 jym return (NULL);
260 1.1.1.1.2.2 jym }
261 1.1.1.1.2.2 jym
262 1.1.1.1.2.2 jym if (code == IRPD_GETHOST_OK) {
263 1.1.1.1.2.2 jym free_host(ho);
264 1.1.1.1.2.2 jym if (irp_unmarshall_ho(ho, body) != 0) {
265 1.1.1.1.2.2 jym ho = NULL;
266 1.1.1.1.2.2 jym }
267 1.1.1.1.2.2 jym } else {
268 1.1.1.1.2.2 jym ho = NULL;
269 1.1.1.1.2.2 jym }
270 1.1.1.1.2.2 jym
271 1.1.1.1.2.2 jym if (body != NULL) {
272 1.1.1.1.2.2 jym memput(body, bodylen);
273 1.1.1.1.2.2 jym }
274 1.1.1.1.2.2 jym
275 1.1.1.1.2.2 jym return (ho);
276 1.1.1.1.2.2 jym }
277 1.1.1.1.2.2 jym
278 1.1.1.1.2.2 jym /*%
279 1.1.1.1.2.2 jym * The implementation for gethostent(3). The first time it's
280 1.1.1.1.2.2 jym * called all the data is pulled from the remote(i.e. what
281 1.1.1.1.2.2 jym * the maximum number of gethostent(3) calls would return)
282 1.1.1.1.2.2 jym * and that data is cached.
283 1.1.1.1.2.2 jym *
284 1.1.1.1.2.2 jym */
285 1.1.1.1.2.2 jym
286 1.1.1.1.2.2 jym static struct hostent *
287 1.1.1.1.2.2 jym ho_next(struct irs_ho *this) {
288 1.1.1.1.2.2 jym struct pvt *pvt = (struct pvt *)this->private;
289 1.1.1.1.2.2 jym struct hostent *ho = &pvt->host;
290 1.1.1.1.2.2 jym char *body;
291 1.1.1.1.2.2 jym size_t bodylen;
292 1.1.1.1.2.2 jym int code;
293 1.1.1.1.2.2 jym char text[256];
294 1.1.1.1.2.2 jym
295 1.1.1.1.2.2 jym if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
296 1.1.1.1.2.2 jym return (NULL);
297 1.1.1.1.2.2 jym }
298 1.1.1.1.2.2 jym
299 1.1.1.1.2.2 jym if (irs_irp_send_command(pvt->girpdata, "gethostent") != 0) {
300 1.1.1.1.2.2 jym return (NULL);
301 1.1.1.1.2.2 jym }
302 1.1.1.1.2.2 jym
303 1.1.1.1.2.2 jym if (irs_irp_get_full_response(pvt->girpdata, &code,
304 1.1.1.1.2.2 jym text, sizeof text,
305 1.1.1.1.2.2 jym &body, &bodylen) != 0) {
306 1.1.1.1.2.2 jym return (NULL);
307 1.1.1.1.2.2 jym }
308 1.1.1.1.2.2 jym
309 1.1.1.1.2.2 jym if (code == IRPD_GETHOST_OK) {
310 1.1.1.1.2.2 jym free_host(ho);
311 1.1.1.1.2.2 jym if (irp_unmarshall_ho(ho, body) != 0) {
312 1.1.1.1.2.2 jym ho = NULL;
313 1.1.1.1.2.2 jym }
314 1.1.1.1.2.2 jym } else {
315 1.1.1.1.2.2 jym ho = NULL;
316 1.1.1.1.2.2 jym }
317 1.1.1.1.2.2 jym
318 1.1.1.1.2.2 jym if (body != NULL) {
319 1.1.1.1.2.2 jym memput(body, bodylen);
320 1.1.1.1.2.2 jym }
321 1.1.1.1.2.2 jym
322 1.1.1.1.2.2 jym return (ho);
323 1.1.1.1.2.2 jym }
324 1.1.1.1.2.2 jym
325 1.1.1.1.2.2 jym /*%
326 1.1.1.1.2.2 jym * void ho_rewind(struct irs_ho *this)
327 1.1.1.1.2.2 jym *
328 1.1.1.1.2.2 jym */
329 1.1.1.1.2.2 jym
330 1.1.1.1.2.2 jym static void
331 1.1.1.1.2.2 jym ho_rewind(struct irs_ho *this) {
332 1.1.1.1.2.2 jym struct pvt *pvt = (struct pvt *)this->private;
333 1.1.1.1.2.2 jym char text[256];
334 1.1.1.1.2.2 jym int code;
335 1.1.1.1.2.2 jym
336 1.1.1.1.2.2 jym if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
337 1.1.1.1.2.2 jym return;
338 1.1.1.1.2.2 jym }
339 1.1.1.1.2.2 jym
340 1.1.1.1.2.2 jym if (irs_irp_send_command(pvt->girpdata, "sethostent") != 0) {
341 1.1.1.1.2.2 jym return;
342 1.1.1.1.2.2 jym }
343 1.1.1.1.2.2 jym
344 1.1.1.1.2.2 jym code = irs_irp_read_response(pvt->girpdata, text, sizeof text);
345 1.1.1.1.2.2 jym if (code != IRPD_GETHOST_SETOK) {
346 1.1.1.1.2.2 jym if (irp_log_errors) {
347 1.1.1.1.2.2 jym syslog(LOG_WARNING, "sethostent failed: %s", text);
348 1.1.1.1.2.2 jym }
349 1.1.1.1.2.2 jym }
350 1.1.1.1.2.2 jym
351 1.1.1.1.2.2 jym return;
352 1.1.1.1.2.2 jym }
353 1.1.1.1.2.2 jym
354 1.1.1.1.2.2 jym /*%
355 1.1.1.1.2.2 jym * void ho_minimize(struct irs_ho *this)
356 1.1.1.1.2.2 jym *
357 1.1.1.1.2.2 jym */
358 1.1.1.1.2.2 jym
359 1.1.1.1.2.2 jym static void
360 1.1.1.1.2.2 jym ho_minimize(struct irs_ho *this) {
361 1.1.1.1.2.2 jym struct pvt *pvt = (struct pvt *)this->private;
362 1.1.1.1.2.2 jym
363 1.1.1.1.2.2 jym free_host(&pvt->host);
364 1.1.1.1.2.2 jym
365 1.1.1.1.2.2 jym irs_irp_disconnect(pvt->girpdata);
366 1.1.1.1.2.2 jym }
367 1.1.1.1.2.2 jym
368 1.1.1.1.2.2 jym /*%
369 1.1.1.1.2.2 jym * void free_host(struct hostent *ho)
370 1.1.1.1.2.2 jym *
371 1.1.1.1.2.2 jym */
372 1.1.1.1.2.2 jym
373 1.1.1.1.2.2 jym static void
374 1.1.1.1.2.2 jym free_host(struct hostent *ho) {
375 1.1.1.1.2.2 jym char **p;
376 1.1.1.1.2.2 jym
377 1.1.1.1.2.2 jym if (ho == NULL) {
378 1.1.1.1.2.2 jym return;
379 1.1.1.1.2.2 jym }
380 1.1.1.1.2.2 jym
381 1.1.1.1.2.2 jym if (ho->h_name != NULL)
382 1.1.1.1.2.2 jym free(ho->h_name);
383 1.1.1.1.2.2 jym
384 1.1.1.1.2.2 jym if (ho->h_aliases != NULL) {
385 1.1.1.1.2.2 jym for (p = ho->h_aliases ; *p != NULL ; p++)
386 1.1.1.1.2.2 jym free(*p);
387 1.1.1.1.2.2 jym free(ho->h_aliases);
388 1.1.1.1.2.2 jym }
389 1.1.1.1.2.2 jym
390 1.1.1.1.2.2 jym if (ho->h_addr_list != NULL) {
391 1.1.1.1.2.2 jym for (p = ho->h_addr_list ; *p != NULL ; p++)
392 1.1.1.1.2.2 jym free(*p);
393 1.1.1.1.2.2 jym free(ho->h_addr_list);
394 1.1.1.1.2.2 jym }
395 1.1.1.1.2.2 jym }
396 1.1.1.1.2.2 jym
397 1.1.1.1.2.2 jym /* dummy */
398 1.1.1.1.2.2 jym static struct addrinfo *
399 1.1.1.1.2.2 jym ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai)
400 1.1.1.1.2.2 jym {
401 1.1.1.1.2.2 jym UNUSED(this);
402 1.1.1.1.2.2 jym UNUSED(name);
403 1.1.1.1.2.2 jym UNUSED(pai);
404 1.1.1.1.2.2 jym return(NULL);
405 1.1.1.1.2.2 jym }
406 1.1.1.1.2.2 jym
407 1.1.1.1.2.2 jym /*! \file */
408