aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-05-23 11:32:44 +0100
committerRon Yorston <rmy@pobox.com>2023-05-23 11:32:44 +0100
commit5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09 (patch)
tree5e739c2dd648786eeff06cc6a65fdff3d5ed8283 /networking
parentc2eb45989fcd59617884dc853743b5cc94b15935 (diff)
parent3e83699ce23400d75c7ddaa7ebfdec015177caa7 (diff)
downloadbusybox-w32-5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09.tar.gz
busybox-w32-5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09.tar.bz2
busybox-w32-5adeafb91fe5d0fbfd2e4f773e64da9aa13d2f09.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'networking')
-rw-r--r--networking/libiproute/ip_parse_common_args.c77
-rw-r--r--networking/libiproute/ipaddress.c10
-rw-r--r--networking/nslookup.c402
3 files changed, 479 insertions, 10 deletions
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index d693c54fa..eccd7e670 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -14,6 +14,83 @@
14#include "ip_common.h" /* #include "libbb.h" is inside */ 14#include "ip_common.h" /* #include "libbb.h" is inside */
15#include "utils.h" 15#include "utils.h"
16 16
17/* iproute2-5.17.0:
18-V, -Version
19 Print the version of the ip utility and exit.
20-h, -human, -human-readable
21 output statistics with human readable values followed by suffix.
22-b, -batch FILENAME
23 Read commands from provided file or standard input and invoke them.
24 First failure will cause termination of ip.
25-force Don't terminate ip on errors in batch mode. If there were any errors
26 during execution of the commands, the application return code will be
27 non zero.
28-s, -stats, -statistics
29 Output more information. If the option appears twice or more,
30 the amount of information increases. As a rule, the information
31 is statistics or some time values.
32-d, -details
33 Output more detailed information.
34-l, -loops COUNT
35 Specify maximum number of loops the 'ip address flush' logic will
36 attempt before giving up. The default is 10. Zero (0) means loop
37 until all addresses are removed.
38-f, -family FAMILY
39 Specifies the protocol family to use. The protocol family identifier
40 can be one of inet, inet6, bridge, mpls or link. If this option is
41 not present, the protocol family is guessed from other arguments.
42 If the rest of the command line does not give enough information
43 to guess the family, ip falls back to the default one, usually inet
44 or any. link is a special family identifier meaning that
45 no networking protocol is involved.
46-4 shortcut for -family inet.
47-6 shortcut for -family inet6.
48-B shortcut for -family bridge.
49-M shortcut for -family mpls.
50-0 shortcut for -family link.
51-o, -oneline
52 output each record on a single line, replacing line feeds with the '\'
53 character. This is convenient when you want to count records with wc(1)
54 or to grep(1) the output.
55-r, -resolve
56 use the system's name resolver to print DNS names instead of addresses.
57-n, -netns NETNS
58 switches ip to the specified network namespace NETNS. Actually it just
59 simplifies executing of:
60 ip netns exec NETNS ip [ OPTIONS ] OBJECT { COMMAND | help }
61 to
62 ip -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
63-N, -Numeric
64 Print the number of protocol, scope, dsfield, etc directly instead of
65 converting it to human readable name.
66-a, -all
67 executes specified command over all objects, it depends if command
68 supports this option.
69-c[color][={always|auto|never}
70 Configure color output. If parameter is omitted or always, color output
71 is enabled regardless of stdout state. If parameter is auto, stdout is
72 checked to be a terminal before enabling color output. If parameter is
73 never, color output is disabled. If specified multiple times, the last
74 one takes precedence. This flag is ignored if -json is also given.
75 Used color palette can be influenced by COLORFGBG environment variable.
76-t, -timestamp
77 display current time when using monitor option.
78-ts, -tshort
79 Like -timestamp, but use shorter format.
80-rc, -rcvbuf SIZE
81 Set the netlink socket receive buffer size, defaults to 1MB.
82-iec print human readable rates in IEC units (e.g. 1Ki = 1024).
83-br, -brief
84 Print only basic information in a tabular format for better readability.
85 This option is currently only supported by ip addr show , ip link show
86 & ip neigh show commands.
87-j, -json
88 Output results in JavaScript Object Notation (JSON).
89-p, -pretty
90 The default JSON format is compact and more efficient to parse but hard
91 for most users to read. This flag adds indentation for readability.
92*/
93
17family_t preferred_family = AF_UNSPEC; 94family_t preferred_family = AF_UNSPEC;
18smallint oneline; 95smallint oneline;
19char _SL_; 96char _SL_;
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index ecc3848ff..c8d77422c 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -44,7 +44,7 @@ struct filter_t {
44 int ifindex; 44 int ifindex;
45 family_t family; 45 family_t family;
46 smallint showqueue; 46 smallint showqueue;
47 smallint oneline; 47 /*smallint oneline; - redundant, global "oneline" flag is enough */
48 smallint up; 48 smallint up;
49 /* Misnomer. Does not mean "flushed something" */ 49 /* Misnomer. Does not mean "flushed something" */
50 /* More like "flush commands were constructed by print_addrinfo()" */ 50 /* More like "flush commands were constructed by print_addrinfo()" */
@@ -297,7 +297,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM,
297 if (n->nlmsg_type == RTM_DELADDR) 297 if (n->nlmsg_type == RTM_DELADDR)
298 printf("Deleted "); 298 printf("Deleted ");
299 299
300 if (G_filter.oneline) 300 if (/*G_filter.*/ oneline)
301 printf("%u: %s", ifa->ifa_index, ll_index_to_name(ifa->ifa_index)); 301 printf("%u: %s", ifa->ifa_index, ll_index_to_name(ifa->ifa_index));
302 if (ifa->ifa_family == AF_INET) 302 if (ifa->ifa_family == AF_INET)
303 printf(" inet "); 303 printf(" inet ");
@@ -427,10 +427,10 @@ static int FAST_FUNC store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr
427 return 0; 427 return 0;
428} 428}
429 429
430static void ipaddr_reset_filter(int _oneline) 430static void ipaddr_reset_filter(void /*int _oneline*/)
431{ 431{
432 memset(&G_filter, 0, sizeof(G_filter)); 432 memset(&G_filter, 0, sizeof(G_filter));
433 G_filter.oneline = _oneline; 433 /*G_filter.oneline = _oneline;*/
434} 434}
435 435
436/* Return value becomes exitcode. It's okay to not return at all */ 436/* Return value becomes exitcode. It's okay to not return at all */
@@ -444,7 +444,7 @@ int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush)
444 struct rtnl_handle rth; 444 struct rtnl_handle rth;
445 char *filter_dev = NULL; 445 char *filter_dev = NULL;
446 446
447 ipaddr_reset_filter(oneline); 447 ipaddr_reset_filter(/*oneline*/);
448 G_filter.showqueue = 1; 448 G_filter.showqueue = 1;
449 449
450 if (G_filter.family == AF_UNSPEC) 450 if (G_filter.family == AF_UNSPEC)
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 6da97baf4..249083e24 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -34,16 +34,14 @@
34//usage: "Name: debian\n" 34//usage: "Name: debian\n"
35//usage: "Address: 127.0.0.1\n" 35//usage: "Address: 127.0.0.1\n"
36 36
37#if !ENABLE_FEATURE_NSLOOKUP_BIG
38
37#include <resolv.h> 39#include <resolv.h>
38#include <net/if.h> /* for IFNAMSIZ */
39//#include <arpa/inet.h> 40//#include <arpa/inet.h>
40//#include <netdb.h> 41//#include <netdb.h>
41#include "libbb.h" 42#include "libbb.h"
42#include "common_bufsiz.h" 43#include "common_bufsiz.h"
43 44
44
45#if !ENABLE_FEATURE_NSLOOKUP_BIG
46
47/* 45/*
48 * Mini nslookup implementation for busybox 46 * Mini nslookup implementation for busybox
49 * 47 *
@@ -248,12 +246,386 @@ int nslookup_main(int argc, char **argv)
248 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 246 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
249 */ 247 */
250 248
249#include "libbb.h"
250#include "common_bufsiz.h"
251
251#if 0 252#if 0
252# define dbg(...) fprintf(stderr, __VA_ARGS__) 253# define dbg(...) fprintf(stderr, __VA_ARGS__)
253#else 254#else
254# define dbg(...) ((void)0) 255# define dbg(...) ((void)0)
255#endif 256#endif
256 257
258/* Instead of using ancient libc DNS query support,
259 * we can carry our own, independent code.
260 * E.g. res_mkquery() loses
261 * three of its paramemters (they are unused!).
262 * Unfortunately, while it does eliminate
263 * ns_get16
264 * ns_get32
265 * ns_name_uncompress
266 * dn_skipname
267 * ns_skiprr
268 * ns_initparse
269 * ns_parserr
270 * libc functions from a static binary, libc versions of
271 * dn_expand and res_mkquery are still linked in
272 * - they are used by getnameinfo(). Each is ~230 bytes of code.
273 * This makes USE_LIBC_RESOLV = 0 code _bigger_ (by about 27 bytes),
274 * despite inlining and constant propagation.
275 */
276#define USE_LIBC_RESOLV 1
277
278#if USE_LIBC_RESOLV
279
280#include <resolv.h>
281
282#else
283
284#define RESOLVFUNC /*nothing*/
285#define BIGRESOLVFUNC /*nothing*/
286#define TINYRESOLVFUNC ALWAYS_INLINE
287
288/* This one is taken from musl 1.2.4 */
289
290#define NS_MAXDNAME 1025
291#define NS_INT32SZ 4
292#define NS_INT16SZ 2
293
294#define MAXDNAME NS_MAXDNAME
295
296typedef enum __ns_opcode {
297 ns_o_query = 0,
298} ns_opcode;
299typedef enum __ns_class {
300 ns_c_in = 1,
301} ns_class;
302typedef enum __ns_sect {
303 ns_s_qd = 0,
304 ns_s_zn = 0,
305 ns_s_an = 1,
306 ns_s_pr = 1,
307 ns_s_ns = 2,
308 ns_s_ud = 2,
309 ns_s_ar = 3,
310 ns_s_max = 4
311} ns_sect;
312typedef enum __ns_type {
313 ns_t_a = 1,
314 ns_t_ns = 2,
315 ns_t_cname = 5,
316 ns_t_soa = 6,
317 ns_t_ptr = 12,
318 ns_t_mx = 15,
319 ns_t_txt = 16,
320 ns_t_aaaa = 28,
321 ns_t_srv = 33,
322 ns_t_any = 255,
323} ns_type;
324#define QUERY ns_o_query
325#define T_A ns_t_a
326#define T_PTR ns_t_ptr
327#define T_AAAA ns_t_aaaa
328#define C_IN ns_c_in
329
330typedef struct __ns_msg {
331 const unsigned char *_msg, *_eom;
332 uint16_t _id, _flags, _counts[ns_s_max];
333 const unsigned char *_sections[ns_s_max];
334 ns_sect _sect;
335 int _rrnum;
336 const unsigned char *_msg_ptr;
337} ns_msg;
338#define ns_msg_id(handle) ((handle)._id + 0)
339#define ns_msg_base(handle) ((handle)._msg + 0)
340#define ns_msg_end(handle) ((handle)._eom + 0)
341#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
342#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
343#define ns_msg_getflag(handle, flag) \
344 (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
345
346typedef struct __ns_rr {
347 char name[NS_MAXDNAME];
348 uint16_t type;
349 uint16_t rr_class;
350 uint32_t ttl;
351 uint16_t rdlength;
352 const unsigned char *rdata;
353} ns_rr;
354#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
355#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
356#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
357#define ns_rr_ttl(rr) ((rr).ttl + 0)
358#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
359#define ns_rr_rdata(rr) ((rr).rdata + 0)
360
361typedef struct {
362 unsigned id :16;
363#if __BYTE_ORDER == __BIG_ENDIAN
364 unsigned qr: 1;
365 unsigned opcode: 4;
366 unsigned aa: 1;
367 unsigned tc: 1;
368 unsigned rd: 1;
369 unsigned ra: 1;
370 unsigned unused :1;
371 unsigned ad: 1;
372 unsigned cd: 1;
373 unsigned rcode :4;
374#else
375 unsigned rd :1;
376 unsigned tc :1;
377 unsigned aa :1;
378 unsigned opcode :4;
379 unsigned qr :1;
380 unsigned rcode :4;
381 unsigned cd: 1;
382 unsigned ad: 1;
383 unsigned unused :1;
384 unsigned ra :1;
385#endif
386 unsigned qdcount :16;
387 unsigned ancount :16;
388 unsigned nscount :16;
389 unsigned arcount :16;
390} HEADER;
391
392#define dn_ns_get16 bb_ns_get16
393static unsigned TINYRESOLVFUNC ns_get16(const unsigned char *cp)
394{
395 return cp[0]<<8 | cp[1];
396}
397#define ns_get32 bb_ns_get32
398static unsigned long TINYRESOLVFUNC ns_get32(const unsigned char *cp)
399{
400 return (unsigned)cp[0]<<24 | cp[1]<<16 | cp[2]<<8 | cp[3];
401}
402#define NS_GET16(s, cp) (void)((s) = ns_get16(((cp)+=2)-2))
403#define NS_GET32(l, cp) (void)((l) = ns_get32(((cp)+=4)-4))
404
405#define dn_expand bb_dn_expand
406static int BIGRESOLVFUNC dn_expand(const unsigned char *base, const unsigned char *end, const unsigned char *src, char *dest, int space)
407{
408 const unsigned char *p = src;
409 char *dend, *dbegin = dest;
410 int len = -1, i, j;
411 if (p==end || space <= 0) return -1;
412 dend = dest + (space > 254 ? 254 : space);
413 /* detect reference loop using an iteration counter */
414 for (i=0; i < end-base; i+=2) {
415 /* loop invariants: p<end, dest<dend */
416 if (*p & 0xc0) {
417 if (p+1==end) return -1;
418 j = ((p[0] & 0x3f) << 8) | p[1];
419 if (len < 0) len = p+2-src;
420 if (j >= end-base) return -1;
421 p = base+j;
422 } else if (*p) {
423 if (dest != dbegin) *dest++ = '.';
424 j = *p++;
425 if (j >= end-p || j >= dend-dest) return -1;
426 while (j--) *dest++ = *p++;
427 } else {
428 *dest = 0;
429 if (len < 0) len = p+1-src;
430 return len;
431 }
432 }
433 return -1;
434}
435
436#define ns_name_uncompress bb_ns_name_uncompress
437static int RESOLVFUNC ns_name_uncompress(const unsigned char *msg, const unsigned char *eom,
438 const unsigned char *src, char *dst, size_t dstsiz)
439{
440 int r;
441 r = dn_expand(msg, eom, src, dst, dstsiz);
442 if (r < 0) errno = EMSGSIZE;
443 return r;
444}
445
446#define dn_skipname bb_dn_skipname
447static int RESOLVFUNC dn_skipname(const unsigned char *s, const unsigned char *end)
448{
449 const unsigned char *p = s;
450 while (p < end)
451 if (!*p) return p-s+1;
452 else if (*p>=192)
453 if (p+1<end) return p-s+2;
454 else break;
455 else
456 if (end-p<*p+1) break;
457 else p += *p + 1;
458 return -1;
459}
460#define ns_skiprr bb_ns_skiprr
461static int BIGRESOLVFUNC ns_skiprr(const unsigned char *ptr, const unsigned char *eom, ns_sect section, int count)
462{
463 const unsigned char *p = ptr;
464 int r;
465
466 while (count--) {
467 r = dn_skipname(p, eom);
468 if (r < 0) goto bad;
469 if (r + 2 * NS_INT16SZ > eom - p) goto bad;
470 p += r + 2 * NS_INT16SZ;
471 if (section != ns_s_qd) {
472 if (NS_INT32SZ + NS_INT16SZ > eom - p) goto bad;
473 p += NS_INT32SZ;
474 NS_GET16(r, p);
475 if (r > eom - p) goto bad;
476 p += r;
477 }
478 }
479 return p - ptr;
480bad:
481 errno = EMSGSIZE;
482 return -1;
483}
484
485#define ns_parserr bb_ns_parserr
486static int BIGRESOLVFUNC ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr)
487{
488 int r;
489
490 if (section < 0 || section >= ns_s_max) goto bad;
491 if (section != handle->_sect) {
492 handle->_sect = section;
493 handle->_rrnum = 0;
494 handle->_msg_ptr = handle->_sections[section];
495 }
496 if (rrnum == -1) rrnum = handle->_rrnum;
497 if (rrnum < 0 || rrnum >= handle->_counts[section]) goto bad;
498 if (rrnum < handle->_rrnum) {
499 handle->_rrnum = 0;
500 handle->_msg_ptr = handle->_sections[section];
501 }
502 if (rrnum > handle->_rrnum) {
503 r = ns_skiprr(handle->_msg_ptr, handle->_eom, section, rrnum - handle->_rrnum);
504 if (r < 0) return -1;
505 handle->_msg_ptr += r;
506 handle->_rrnum = rrnum;
507 }
508 r = ns_name_uncompress(handle->_msg, handle->_eom, handle->_msg_ptr, rr->name, NS_MAXDNAME);
509 if (r < 0) return -1;
510 handle->_msg_ptr += r;
511 if (2 * NS_INT16SZ > handle->_eom - handle->_msg_ptr) goto size;
512 NS_GET16(rr->type, handle->_msg_ptr);
513 NS_GET16(rr->rr_class, handle->_msg_ptr);
514 if (section != ns_s_qd) {
515 if (NS_INT32SZ + NS_INT16SZ > handle->_eom - handle->_msg_ptr) goto size;
516 NS_GET32(rr->ttl, handle->_msg_ptr);
517 NS_GET16(rr->rdlength, handle->_msg_ptr);
518 if (rr->rdlength > handle->_eom - handle->_msg_ptr) goto size;
519 rr->rdata = handle->_msg_ptr;
520 handle->_msg_ptr += rr->rdlength;
521 } else {
522 rr->ttl = 0;
523 rr->rdlength = 0;
524 rr->rdata = NULL;
525 }
526 handle->_rrnum++;
527 if (handle->_rrnum > handle->_counts[section]) {
528 handle->_sect = section + 1;
529 if (handle->_sect == ns_s_max) {
530 handle->_rrnum = -1;
531 handle->_msg_ptr = NULL;
532 } else {
533 handle->_rrnum = 0;
534 }
535 }
536 return 0;
537bad:
538 errno = ENODEV;
539 return -1;
540size:
541 errno = EMSGSIZE;
542 return -1;
543}
544
545#define ns_initparse bb_ns_initparse
546static int BIGRESOLVFUNC ns_initparse(const unsigned char *msg, int msglen, ns_msg *handle)
547{
548 int i, r;
549
550 handle->_msg = msg;
551 handle->_eom = msg + msglen;
552 if (msglen < (2 + ns_s_max) * NS_INT16SZ) goto bad;
553 NS_GET16(handle->_id, msg);
554 NS_GET16(handle->_flags, msg);
555 for (i = 0; i < ns_s_max; i++) NS_GET16(handle->_counts[i], msg);
556 for (i = 0; i < ns_s_max; i++) {
557 if (handle->_counts[i]) {
558 handle->_sections[i] = msg;
559 r = ns_skiprr(msg, handle->_eom, i, handle->_counts[i]);
560 if (r < 0) return -1;
561 msg += r;
562 } else {
563 handle->_sections[i] = NULL;
564 }
565 }
566 if (msg != handle->_eom) goto bad;
567 handle->_sect = ns_s_max;
568 handle->_rrnum = -1;
569 handle->_msg_ptr = NULL;
570 return 0;
571bad:
572 errno = EMSGSIZE;
573 return -1;
574}
575
576#define res_mkquery bb_res_mkquery
577static int RESOLVFUNC res_mkquery(int op, const char *dname, int class, int type,
578 const unsigned char *data UNUSED_PARAM, int datalen UNUSED_PARAM,
579 const unsigned char *newrr UNUSED_PARAM, unsigned char *buf, int buflen)
580{
581 int i, j;
582 unsigned char q[280];
583 size_t l = strnlen(dname, 255);
584 int n;
585
586 if (l && dname[l-1]=='.') l--;
587 if (l && dname[l-1]=='.') return -1;
588 n = 17+l+!!l;
589 if (l>253 || buflen<n || op>15u || class>255u || type>255u)
590 return -1;
591
592//TODO: why do we even have the q[] array? Use buf[] directly!
593 /* Construct query template - ID will be filled later */
594 memset(q, 0, n);
595 q[2] = op*8 + 1;
596 q[3] = 32; /* AD */
597 q[5] = 1;
598 memcpy((char *)q+13, dname, l);
599 for (i=13; q[i]; i=j+1) {
600 for (j=i; q[j] && q[j] != '.'; j++);
601 if (j-i-1u > 62u) return -1;
602 q[i-1] = j-i;
603 }
604 q[i+1] = type;
605 q[i+3] = class;
606#if 0
607//For some machines (here: a TP-Link RE200 powered by a MediaTek MT7620A)
608//the monotonic clock has a coarse resolution (here: 20us) and it can happen
609//that the requests for A and AAAA share the same transaction ID.
610
611//In that case the mapping from received responses to the sent queries
612//doesn't work and name resolution fails because the AAAA reply
613//is dropped as a duplicate reply to the A query.
614 /* Make a reasonably unpredictable id */
615 unsigned id;
616 struct timespec ts;
617 clock_gettime(CLOCK_REALTIME, &ts);
618 id = ts.tv_nsec + ((uint32_t)(ts.tv_nsec) >> 16);
619 q[0] = id/256;
620 q[1] = id;
621#endif
622 memcpy(buf, q, n);
623 return n;
624}
625
626#endif /* !USE_LIBC_RESOLV */
627
628
257struct ns { 629struct ns {
258 const char *name; 630 const char *name;
259 len_and_sockaddr *lsa; 631 len_and_sockaddr *lsa;
@@ -266,7 +638,12 @@ struct query {
266 unsigned qlen; 638 unsigned qlen;
267// unsigned latency; 639// unsigned latency;
268// uint8_t rcode; 640// uint8_t rcode;
269 unsigned char query[512]; 641 /* res_mkquery() balks on names > 253 chars.
642 * The formed query is 253+18 chars at max.
643 * Real hostnames are nowhere near that long anyway.
644 * Use of power-of-2 size means smaller code.
645 */
646 unsigned char query[512 - sizeof(int) - sizeof(char*)];
270// unsigned char reply[512]; 647// unsigned char reply[512];
271}; 648};
272 649
@@ -978,6 +1355,21 @@ int nslookup_main(int argc UNUSED_PARAM, char **argv)
978 } 1355 }
979 } 1356 }
980 1357
1358 /* Ensure the Transaction IDs are unique.
1359 * See, for example, musl source of res_mkquery() where
1360 * it risks using current time (same value!) for ALL queries.
1361 */
1362 {
1363 struct timeval tv;
1364 unsigned id;
1365 xgettimeofday(&tv);
1366 id = tv.tv_sec + tv.tv_usec;
1367 for (rc = 0; rc < G.query_count; rc++) {
1368 G.query[rc].query[0] = id >> 8;
1369 G.query[rc].query[1] = id++;
1370 }
1371 }
1372
981 for (rc = 0; rc < G.serv_count;) { 1373 for (rc = 0; rc < G.serv_count;) {
982 int c; 1374 int c;
983 1375