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