blob: 84e139ced03c3e7ee5647005b4227d6ed9e67e0b [file] [log] [blame]
Rusty Russell79dee072000-05-02 16:45:16 +00001/* Library which manipulates firewall rules. Version 0.1. */
2
3/* Architecture of firewall rules is as follows:
4 *
5 * Chains go INPUT, FORWARD, OUTPUT then user chains.
6 * Each user chain starts with an ERROR node.
7 * Every chain ends with an unconditional jump: a RETURN for user chains,
8 * and a POLICY for built-ins.
9 */
10
11/* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See
12 COPYING for details). */
13
14#include <assert.h>
15#include <string.h>
16#include <errno.h>
17#include <stdlib.h>
18#include <stdio.h>
Marc Boucher1afc3b62002-01-19 12:46:39 +000019#include <unistd.h>
Rusty Russell79dee072000-05-02 16:45:16 +000020#include <arpa/inet.h>
21
22#ifdef DEBUG_CONNTRACK
23#define inline
24#endif
25
26#if !defined(__GLIBC__) || (__GLIBC__ < 2)
27typedef unsigned int socklen_t;
28#endif
29
30#include "libiptc/libip6tc.h"
31
32#define HOOK_PRE_ROUTING NF_IP6_PRE_ROUTING
33#define HOOK_LOCAL_IN NF_IP6_LOCAL_IN
34#define HOOK_FORWARD NF_IP6_FORWARD
35#define HOOK_LOCAL_OUT NF_IP6_LOCAL_OUT
36#define HOOK_POST_ROUTING NF_IP6_POST_ROUTING
37
38#define STRUCT_ENTRY_TARGET struct ip6t_entry_target
39#define STRUCT_ENTRY struct ip6t_entry
40#define STRUCT_ENTRY_MATCH struct ip6t_entry_match
41#define STRUCT_GETINFO struct ip6t_getinfo
42#define STRUCT_GET_ENTRIES struct ip6t_get_entries
43#define STRUCT_COUNTERS struct ip6t_counters
44#define STRUCT_COUNTERS_INFO struct ip6t_counters_info
45#define STRUCT_STANDARD_TARGET struct ip6t_standard_target
46#define STRUCT_REPLACE struct ip6t_replace
47
48#define STRUCT_TC_HANDLE struct ip6tc_handle
49#define TC_HANDLE_T ip6tc_handle_t
50
51#define ENTRY_ITERATE IP6T_ENTRY_ITERATE
52#define TABLE_MAXNAMELEN IP6T_TABLE_MAXNAMELEN
53#define FUNCTION_MAXNAMELEN IP6T_FUNCTION_MAXNAMELEN
54
55#define GET_TARGET ip6t_get_target
56
57#define ERROR_TARGET IP6T_ERROR_TARGET
58#define NUMHOOKS NF_IP6_NUMHOOKS
59
60#define IPT_CHAINLABEL ip6t_chainlabel
61
62#define TC_DUMP_ENTRIES dump_entries6
63#define TC_IS_CHAIN ip6tc_is_chain
Philip Blundell8c700902000-05-15 02:17:52 +000064#define TC_FIRST_CHAIN ip6tc_first_chain
Rusty Russell79dee072000-05-02 16:45:16 +000065#define TC_NEXT_CHAIN ip6tc_next_chain
Philip Blundell8c700902000-05-15 02:17:52 +000066#define TC_FIRST_RULE ip6tc_first_rule
67#define TC_NEXT_RULE ip6tc_next_rule
Rusty Russell79dee072000-05-02 16:45:16 +000068#define TC_GET_TARGET ip6tc_get_target
69#define TC_BUILTIN ip6tc_builtin
70#define TC_GET_POLICY ip6tc_get_policy
71#define TC_INSERT_ENTRY ip6tc_insert_entry
72#define TC_REPLACE_ENTRY ip6tc_replace_entry
73#define TC_APPEND_ENTRY ip6tc_append_entry
74#define TC_DELETE_ENTRY ip6tc_delete_entry
75#define TC_DELETE_NUM_ENTRY ip6tc_delete_num_entry
76#define TC_CHECK_PACKET ip6tc_check_packet
77#define TC_FLUSH_ENTRIES ip6tc_flush_entries
78#define TC_ZERO_ENTRIES ip6tc_zero_entries
Harald Welte1cef74d2001-01-05 15:22:59 +000079#define TC_ZERO_COUNTER ip6tc_zero_counter
80#define TC_READ_COUNTER ip6tc_read_counter
81#define TC_SET_COUNTER ip6tc_set_counter
Rusty Russell79dee072000-05-02 16:45:16 +000082#define TC_CREATE_CHAIN ip6tc_create_chain
83#define TC_GET_REFERENCES ip6tc_get_references
84#define TC_DELETE_CHAIN ip6tc_delete_chain
85#define TC_RENAME_CHAIN ip6tc_rename_chain
86#define TC_SET_POLICY ip6tc_set_policy
87#define TC_GET_RAW_SOCKET ip6tc_get_raw_socket
88#define TC_INIT ip6tc_init
Martin Josefsson841e4ae2003-05-02 15:30:11 +000089#define TC_FREE ip6tc_free
Rusty Russell79dee072000-05-02 16:45:16 +000090#define TC_COMMIT ip6tc_commit
91#define TC_STRERROR ip6tc_strerror
92
93#define TC_AF AF_INET6
94#define TC_IPPROTO IPPROTO_IPV6
95
96#define SO_SET_REPLACE IP6T_SO_SET_REPLACE
97#define SO_SET_ADD_COUNTERS IP6T_SO_SET_ADD_COUNTERS
98#define SO_GET_INFO IP6T_SO_GET_INFO
99#define SO_GET_ENTRIES IP6T_SO_GET_ENTRIES
100#define SO_GET_VERSION IP6T_SO_GET_VERSION
101
102#define STANDARD_TARGET IP6T_STANDARD_TARGET
103#define LABEL_RETURN IP6TC_LABEL_RETURN
104#define LABEL_ACCEPT IP6TC_LABEL_ACCEPT
105#define LABEL_DROP IP6TC_LABEL_DROP
Philip Blundell88eb8352000-05-10 00:25:04 +0000106#define LABEL_QUEUE IP6TC_LABEL_QUEUE
Rusty Russell79dee072000-05-02 16:45:16 +0000107
108#define ALIGN IP6T_ALIGN
109#define RETURN IP6T_RETURN
110
111#include "libiptc.c"
112
113#define BIT6(a, l) \
114 (((a->in6_u.u6_addr32[(l) / 32]) >> ((l) & 31)) & 1)
115
116int
117ipv6_prefix_length(const struct in6_addr *a)
118{
119 int l, i;
120 for (l = 0; l < 128; l++) {
121 if (BIT6(a, l) == 0)
122 break;
123 }
124 for (i = l + 1; i < 128; i++) {
125 if (BIT6(a, i) == 1)
126 return -1;
127 }
128 return l;
129}
130
131static int
132dump_entry(struct ip6t_entry *e, const ip6tc_handle_t handle)
133{
134 size_t i;
135 char buf[40];
136 int len;
137 struct ip6t_entry_target *t;
138
139 printf("Entry %u (%lu):\n", entry2index(handle, e),
140 entry2offset(handle, e));
141 puts("SRC IP: ");
142 inet_ntop(AF_INET6, &e->ipv6.src, buf, sizeof buf);
143 puts(buf);
144 putchar('/');
145 len = ipv6_prefix_length(&e->ipv6.smsk);
146 if (len != -1)
147 printf("%d", len);
148 else {
149 inet_ntop(AF_INET6, &e->ipv6.smsk, buf, sizeof buf);
150 puts(buf);
151 }
152 putchar('\n');
153
154 puts("DST IP: ");
155 inet_ntop(AF_INET6, &e->ipv6.dst, buf, sizeof buf);
156 puts(buf);
157 putchar('/');
158 len = ipv6_prefix_length(&e->ipv6.dmsk);
159 if (len != -1)
160 printf("%d", len);
161 else {
162 inet_ntop(AF_INET6, &e->ipv6.dmsk, buf, sizeof buf);
163 puts(buf);
164 }
165 putchar('\n');
166
167 printf("Interface: `%s'/", e->ipv6.iniface);
168 for (i = 0; i < IFNAMSIZ; i++)
169 printf("%c", e->ipv6.iniface_mask[i] ? 'X' : '.');
170 printf("to `%s'/", e->ipv6.outiface);
171 for (i = 0; i < IFNAMSIZ; i++)
172 printf("%c", e->ipv6.outiface_mask[i] ? 'X' : '.');
173 printf("\nProtocol: %u\n", e->ipv6.proto);
174 if (e->ipv6.flags & IP6T_F_TOS)
175 printf("TOS: %u\n", e->ipv6.tos);
176 printf("Flags: %02X\n", e->ipv6.flags);
177 printf("Invflags: %02X\n", e->ipv6.invflags);
178 printf("Counters: %llu packets, %llu bytes\n",
179 e->counters.pcnt, e->counters.bcnt);
180 printf("Cache: %08X ", e->nfcache);
181 if (e->nfcache & NFC_ALTERED) printf("ALTERED ");
182 if (e->nfcache & NFC_UNKNOWN) printf("UNKNOWN ");
183 if (e->nfcache & NFC_IP6_SRC) printf("IP6_SRC ");
184 if (e->nfcache & NFC_IP6_DST) printf("IP6_DST ");
185 if (e->nfcache & NFC_IP6_IF_IN) printf("IP6_IF_IN ");
186 if (e->nfcache & NFC_IP6_IF_OUT) printf("IP6_IF_OUT ");
187 if (e->nfcache & NFC_IP6_TOS) printf("IP6_TOS ");
188 if (e->nfcache & NFC_IP6_PROTO) printf("IP6_PROTO ");
189 if (e->nfcache & NFC_IP6_OPTIONS) printf("IP6_OPTIONS ");
190 if (e->nfcache & NFC_IP6_TCPFLAGS) printf("IP6_TCPFLAGS ");
191 if (e->nfcache & NFC_IP6_SRC_PT) printf("IP6_SRC_PT ");
192 if (e->nfcache & NFC_IP6_DST_PT) printf("IP6_DST_PT ");
193 if (e->nfcache & NFC_IP6_PROTO_UNKNOWN) printf("IP6_PROTO_UNKNOWN ");
194 printf("\n");
195
196 IP6T_MATCH_ITERATE(e, print_match);
197
198 t = ip6t_get_target(e);
Philip Blundell88eb8352000-05-10 00:25:04 +0000199 printf("Target name: `%s' [%u]\n", t->u.user.name, t->u.target_size);
200 if (strcmp(t->u.user.name, IP6T_STANDARD_TARGET) == 0) {
Rusty Russell79dee072000-05-02 16:45:16 +0000201 int pos = *(int *)t->data;
202 if (pos < 0)
203 printf("verdict=%s\n",
204 pos == -NF_ACCEPT-1 ? "NF_ACCEPT"
205 : pos == -NF_DROP-1 ? "NF_DROP"
206 : pos == IP6T_RETURN ? "RETURN"
207 : "UNKNOWN");
208 else
209 printf("verdict=%u\n", pos);
Philip Blundell88eb8352000-05-10 00:25:04 +0000210 } else if (strcmp(t->u.user.name, IP6T_ERROR_TARGET) == 0)
Rusty Russell79dee072000-05-02 16:45:16 +0000211 printf("error=`%s'\n", t->data);
212
213 printf("\n");
214 return 0;
215}
216
Philip Blundell88eb8352000-05-10 00:25:04 +0000217static int
218is_same(const STRUCT_ENTRY *a, const STRUCT_ENTRY *b,
Rusty Russell79dee072000-05-02 16:45:16 +0000219 unsigned char *matchmask)
220{
221 unsigned int i;
Philip Blundell88eb8352000-05-10 00:25:04 +0000222 STRUCT_ENTRY_TARGET *ta, *tb;
Rusty Russell79dee072000-05-02 16:45:16 +0000223 unsigned char *mptr;
224
225 /* Always compare head structures: ignore mask here. */
226 if (memcmp(&a->ipv6.src, &b->ipv6.src, sizeof(struct in6_addr))
227 || memcmp(&a->ipv6.dst, &b->ipv6.dst, sizeof(struct in6_addr))
228 || memcmp(&a->ipv6.smsk, &b->ipv6.smsk, sizeof(struct in6_addr))
229 || memcmp(&a->ipv6.dmsk, &b->ipv6.dmsk, sizeof(struct in6_addr))
230 || a->ipv6.proto != b->ipv6.proto
231 || a->ipv6.tos != b->ipv6.tos
232 || a->ipv6.flags != b->ipv6.flags
233 || a->ipv6.invflags != b->ipv6.invflags)
234 return 0;
235
236 for (i = 0; i < IFNAMSIZ; i++) {
237 if (a->ipv6.iniface_mask[i] != b->ipv6.iniface_mask[i])
238 return 0;
239 if ((a->ipv6.iniface[i] & a->ipv6.iniface_mask[i])
240 != (b->ipv6.iniface[i] & b->ipv6.iniface_mask[i]))
241 return 0;
242 if (a->ipv6.outiface_mask[i] != b->ipv6.outiface_mask[i])
243 return 0;
244 if ((a->ipv6.outiface[i] & a->ipv6.outiface_mask[i])
245 != (b->ipv6.outiface[i] & b->ipv6.outiface_mask[i]))
246 return 0;
247 }
248
249 if (a->nfcache != b->nfcache
250 || a->target_offset != b->target_offset
251 || a->next_offset != b->next_offset)
252 return 0;
253
Philip Blundell88eb8352000-05-10 00:25:04 +0000254 mptr = matchmask + sizeof(STRUCT_ENTRY);
255 if (IP6T_MATCH_ITERATE(a, match_different, a->elems, b->elems, &mptr))
Rusty Russell79dee072000-05-02 16:45:16 +0000256 return 0;
257
Philip Blundell88eb8352000-05-10 00:25:04 +0000258 ta = GET_TARGET((STRUCT_ENTRY *)a);
259 tb = GET_TARGET((STRUCT_ENTRY *)b);
260 if (ta->u.target_size != tb->u.target_size)
Rusty Russell79dee072000-05-02 16:45:16 +0000261 return 0;
Philip Blundell88eb8352000-05-10 00:25:04 +0000262 if (strcmp(ta->u.user.name, tb->u.user.name) != 0)
Rusty Russell79dee072000-05-02 16:45:16 +0000263 return 0;
264 mptr += sizeof(*ta);
265
266 if (target_different(ta->data, tb->data,
267 ta->u.target_size - sizeof(*ta), mptr))
268 return 0;
269
270 return 1;
271}
Philip Blundell8c700902000-05-15 02:17:52 +0000272
Rusty Russell5eed48a2000-06-02 20:12:24 +0000273/* All zeroes == unconditional rule. */
274static inline int
275unconditional(const struct ip6t_ip6 *ipv6)
276{
277 unsigned int i;
278
279 for (i = 0; i < sizeof(*ipv6); i++)
280 if (((char *)ipv6)[i])
281 break;
282
283 return (i == sizeof(*ipv6));
284}
285
Harald Welte380ba5f2002-02-13 16:19:55 +0000286#ifdef IPTC_DEBUG
Philip Blundell8c700902000-05-15 02:17:52 +0000287/* Do every conceivable sanity check on the handle */
288static void
289do_check(TC_HANDLE_T h, unsigned int line)
290{
291 unsigned int i, n;
292 unsigned int user_offset; /* Offset of first user chain */
293 int was_return;
294
295 assert(h->changed == 0 || h->changed == 1);
296 if (strcmp(h->info.name, "filter") == 0) {
297 assert(h->info.valid_hooks
298 == (1 << NF_IP6_LOCAL_IN
299 | 1 << NF_IP6_FORWARD
300 | 1 << NF_IP6_LOCAL_OUT));
301
302 /* Hooks should be first three */
303 assert(h->info.hook_entry[NF_IP6_LOCAL_IN] == 0);
304
305 n = get_chain_end(h, 0);
306 n += get_entry(h, n)->next_offset;
307 assert(h->info.hook_entry[NF_IP6_FORWARD] == n);
308
309 n = get_chain_end(h, n);
310 n += get_entry(h, n)->next_offset;
311 assert(h->info.hook_entry[NF_IP6_LOCAL_OUT] == n);
312
313 user_offset = h->info.hook_entry[NF_IP6_LOCAL_OUT];
314 } else if (strcmp(h->info.name, "nat") == 0) {
Harald Welte95df8e72002-02-13 23:13:23 +0000315 assert((h->info.valid_hooks
316 == (1 << NF_IP6_PRE_ROUTING
317 | 1 << NF_IP6_LOCAL_OUT
318 | 1 << NF_IP6_POST_ROUTING)) ||
319 (h->info.valid_hooks
320 == (1 << NF_IP6_PRE_ROUTING
321 | 1 << NF_IP6_LOCAL_IN
322 | 1 << NF_IP6_LOCAL_OUT
323 | 1 << NF_IP6_POST_ROUTING)));
Philip Blundell8c700902000-05-15 02:17:52 +0000324
325 assert(h->info.hook_entry[NF_IP6_PRE_ROUTING] == 0);
326
327 n = get_chain_end(h, 0);
Harald Welte95df8e72002-02-13 23:13:23 +0000328
Philip Blundell8c700902000-05-15 02:17:52 +0000329 n += get_entry(h, n)->next_offset;
330 assert(h->info.hook_entry[NF_IP6_POST_ROUTING] == n);
Philip Blundell8c700902000-05-15 02:17:52 +0000331 n = get_chain_end(h, n);
Harald Welte95df8e72002-02-13 23:13:23 +0000332
Philip Blundell8c700902000-05-15 02:17:52 +0000333 n += get_entry(h, n)->next_offset;
334 assert(h->info.hook_entry[NF_IP6_LOCAL_OUT] == n);
Philip Blundell8c700902000-05-15 02:17:52 +0000335 user_offset = h->info.hook_entry[NF_IP6_LOCAL_OUT];
Harald Welte95df8e72002-02-13 23:13:23 +0000336
337 if (h->info.valid_hooks & (1 << NF_IP6_LOCAL_IN)) {
338 n = get_chain_end(h, n);
339 n += get_entry(h, n)->next_offset;
340 assert(h->info.hook_entry[NF_IP6_LOCAL_IN] == n);
341 user_offset = h->info.hook_entry[NF_IP6_LOCAL_IN];
342 }
343
Philip Blundell8c700902000-05-15 02:17:52 +0000344 } else if (strcmp(h->info.name, "mangle") == 0) {
Harald Welte596707c2002-02-13 16:35:39 +0000345 /* This code is getting ugly because linux < 2.4.18-pre6 had
346 * two mangle hooks, linux >= 2.4.18-pre6 has five mangle hooks
347 * */
Harald Welte95df8e72002-02-13 23:13:23 +0000348 assert((h->info.valid_hooks
349 == (1 << NF_IP6_PRE_ROUTING
350 | 1 << NF_IP6_LOCAL_OUT)) ||
351 (h->info.valid_hooks
352 == (1 << NF_IP6_PRE_ROUTING
353 | 1 << NF_IP6_LOCAL_IN
354 | 1 << NF_IP6_FORWARD
355 | 1 << NF_IP6_LOCAL_OUT
356 | 1 << NF_IP6_POST_ROUTING)));
Philip Blundell8c700902000-05-15 02:17:52 +0000357
Harald Welte380ba5f2002-02-13 16:19:55 +0000358 /* Hooks should be first five */
Philip Blundell8c700902000-05-15 02:17:52 +0000359 assert(h->info.hook_entry[NF_IP6_PRE_ROUTING] == 0);
360
361 n = get_chain_end(h, 0);
Harald Welte380ba5f2002-02-13 16:19:55 +0000362
Harald Weltea540b1b2002-02-13 22:42:52 +0000363 if (h->info.valid_hooks & (1 << NF_IP6_LOCAL_IN)) {
Harald Welte596707c2002-02-13 16:35:39 +0000364 n += get_entry(h, n)->next_offset;
365 assert(h->info.hook_entry[NF_IP6_LOCAL_IN] == n);
366 n = get_chain_end(h, n);
367 }
Harald Welte380ba5f2002-02-13 16:19:55 +0000368
Harald Weltea540b1b2002-02-13 22:42:52 +0000369 if (h->info.valid_hooks & (1 << NF_IP6_FORWARD)) {
Harald Welte596707c2002-02-13 16:35:39 +0000370 n += get_entry(h, n)->next_offset;
371 assert(h->info.hook_entry[NF_IP6_FORWARD] == n);
372 n = get_chain_end(h, n);
373 }
374
Harald Welte380ba5f2002-02-13 16:19:55 +0000375 n += get_entry(h, n)->next_offset;
Philip Blundell8c700902000-05-15 02:17:52 +0000376 assert(h->info.hook_entry[NF_IP6_LOCAL_OUT] == n);
Harald Welte596707c2002-02-13 16:35:39 +0000377 user_offset = h->info.hook_entry[NF_IP6_LOCAL_OUT];
Philip Blundell8c700902000-05-15 02:17:52 +0000378
Harald Weltea540b1b2002-02-13 22:42:52 +0000379 if (h->info.valid_hooks & (1 << NF_IP6_POST_ROUTING)) {
Harald Welte596707c2002-02-13 16:35:39 +0000380 n = get_chain_end(h, n);
381 n += get_entry(h, n)->next_offset;
382 assert(h->info.hook_entry[NF_IP6_POST_ROUTING] == n);
383 user_offset = h->info.hook_entry[NF_IP6_POST_ROUTING];
384 }
Harald Weltea540b1b2002-02-13 22:42:52 +0000385 } else {
386 fprintf(stderr, "Unknown table `%s'\n", h->info.name);
Philip Blundell8c700902000-05-15 02:17:52 +0000387 abort();
Harald Weltea540b1b2002-02-13 22:42:52 +0000388 }
Philip Blundell8c700902000-05-15 02:17:52 +0000389
390 /* User chain == end of last builtin + policy entry */
391 user_offset = get_chain_end(h, user_offset);
392 user_offset += get_entry(h, user_offset)->next_offset;
393
394 /* Overflows should be end of entry chains, and unconditional
395 policy nodes. */
396 for (i = 0; i < NUMHOOKS; i++) {
397 STRUCT_ENTRY *e;
398 STRUCT_STANDARD_TARGET *t;
399
400 if (!(h->info.valid_hooks & (1 << i)))
401 continue;
402 assert(h->info.underflow[i]
403 == get_chain_end(h, h->info.hook_entry[i]));
404
405 e = get_entry(h, get_chain_end(h, h->info.hook_entry[i]));
Rusty Russell5eed48a2000-06-02 20:12:24 +0000406 assert(unconditional(&e->ipv6));
Philip Blundell8c700902000-05-15 02:17:52 +0000407 assert(e->target_offset == sizeof(*e));
408 t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e);
Harald Weltea540b1b2002-02-13 22:42:52 +0000409 printf("target_size=%u, align=%u\n",
410 t->target.u.target_size, ALIGN(sizeof(*t)));
Philip Blundell8c700902000-05-15 02:17:52 +0000411 assert(t->target.u.target_size == ALIGN(sizeof(*t)));
412 assert(e->next_offset == sizeof(*e) + ALIGN(sizeof(*t)));
413
414 assert(strcmp(t->target.u.user.name, STANDARD_TARGET)==0);
415 assert(t->verdict == -NF_DROP-1 || t->verdict == -NF_ACCEPT-1);
416
417 /* Hooks and underflows must be valid entries */
418 entry2index(h, get_entry(h, h->info.hook_entry[i]));
419 entry2index(h, get_entry(h, h->info.underflow[i]));
420 }
421
422 assert(h->info.size
423 >= h->info.num_entries * (sizeof(STRUCT_ENTRY)
424 +sizeof(STRUCT_STANDARD_TARGET)));
425
426 assert(h->entries.size
427 >= (h->new_number
428 * (sizeof(STRUCT_ENTRY)
429 + sizeof(STRUCT_STANDARD_TARGET))));
430 assert(strcmp(h->info.name, h->entries.name) == 0);
431
432 i = 0; n = 0;
433 was_return = 0;
434
Rusty Russell5eed48a2000-06-02 20:12:24 +0000435#if 0
Philip Blundell8c700902000-05-15 02:17:52 +0000436 /* Check all the entries. */
Harald Weltea540b1b2002-02-13 22:42:52 +0000437 ENTRY_ITERATE(h->entries.entrytable, h->entries.size,
Rusty Russell5eed48a2000-06-02 20:12:24 +0000438 check_entry, &i, &n, user_offset, &was_return, h);
Philip Blundell8c700902000-05-15 02:17:52 +0000439
440 assert(i == h->new_number);
441 assert(n == h->entries.size);
442
443 /* Final entry must be error node */
444 assert(strcmp(GET_TARGET(index2entry(h, h->new_number-1))
445 ->u.user.name,
446 ERROR_TARGET) == 0);
Rusty Russell5eed48a2000-06-02 20:12:24 +0000447#endif
Philip Blundell8c700902000-05-15 02:17:52 +0000448}
Harald Welte380ba5f2002-02-13 16:19:55 +0000449#endif /*IPTC_DEBUG*/