pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/etherape PR/27224: Daniel Carosone: Etherape is mu...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a7cf50a320aa
branches:  trunk
changeset: 485984:a7cf50a320aa
user:      christos <christos%pkgsrc.org@localhost>
date:      Mon Dec 20 23:24:02 2004 +0000

description:
PR/27224: Daniel Carosone: Etherape is multi-threaded and uses _res. Fixed to
use the new resolver functions.

diffstat:

 net/etherape/distinfo         |   3 +-
 net/etherape/patches/patch-ab |  85 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 1 deletions(-)

diffs (100 lines):

diff -r 276a8b229bda -r a7cf50a320aa net/etherape/distinfo
--- a/net/etherape/distinfo     Mon Dec 20 23:16:54 2004 +0000
+++ b/net/etherape/distinfo     Mon Dec 20 23:24:02 2004 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.3 2004/11/22 15:27:53 adam Exp $
+$NetBSD: distinfo,v 1.4 2004/12/20 23:24:02 christos Exp $
 
 SHA1 (etherape-0.9.1.tar.gz) = d9eb267e1ff5992bf120f8bbefc974660a203909
 Size (etherape-0.9.1.tar.gz) = 447092 bytes
 SHA1 (patch-aa) = e6b41ead7de0a0ce5f293f742e3e79cfe2d65021
+SHA1 (patch-ab) = 36ba395ccd63348e16ac4e6fff724af17fa12082
diff -r 276a8b229bda -r a7cf50a320aa net/etherape/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/etherape/patches/patch-ab     Mon Dec 20 23:24:02 2004 +0000
@@ -0,0 +1,85 @@
+$NetBSD: patch-ab,v 1.1 2004/12/20 23:24:02 christos Exp $
+
+--- src/dns.c.orig     2003-04-06 09:45:41.000000000 -0400
++++ src/dns.c  2004-12-20 18:15:45.000000000 -0500
+@@ -60,6 +60,17 @@
+ #define strerror(errno) (((errno) >= 0 && (errno) < sys_nerr) ? sys_errlist[errno] : "unlisted error")
+ #endif
+ 
++#ifdef res_ninit
++#define RES_INIT() res_ninit(&myres);
++#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \
++    res_nmkquery(&myres, a, b, c, d, e, f, g, h, i)
++struct __res_state myres;
++#else
++#define myres _res
++#define RES_INIT() res_init();
++#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \
++    res_mkquery(a, b, c, d, e, f, g, h, i)
++#endif
+ 
+ 
+ /*  Hmm, it seems Irix requires this  */
+@@ -432,15 +443,15 @@
+ dns_open (void)
+ {
+   int option, i;
+-  res_init ();
+-  if (!_res.nscount)
++  RES_INIT();
++  if (!myres.nscount)
+     {
+       fprintf (stderr, "No nameservers defined.\n");
+       exit (-1);
+     }
+-  _res.options |= RES_RECURSE | RES_DEFNAMES | RES_DNSRCH;
+-  for (i = 0; i < _res.nscount; i++)
+-    _res.nsaddr_list[i].sin_family = AF_INET;
++  myres.options |= RES_RECURSE | RES_DEFNAMES | RES_DNSRCH;
++  for (i = 0; i < myres.nscount; i++)
++    myres.nsaddr_list[i].sin_family = AF_INET;
+   resfd = socket (AF_INET, SOCK_DGRAM, 0);
+   if (resfd == -1)
+     {
+@@ -755,7 +766,7 @@
+   int r, i;
+   int buf[(MaxPacketsize / sizeof (int)) + 1];
+ 
+-  r = res_mkquery (QUERY, s, C_IN, type, NULL, 0, NULL, (u_char *) buf,
++  r = RES_MKQUERY (QUERY, s, C_IN, type, NULL, 0, NULL, (u_char *) buf,
+                  MaxPacketsize);
+   if (r == -1)
+     {
+@@ -764,9 +775,9 @@
+     }
+   hp = (packetheader *) buf;
+   hp->id = id;                        /* htons() deliberately left out (redundant) */
+-  for (i = 0; i < _res.nscount; i++)
++  for (i = 0; i < myres.nscount; i++)
+     (void) sendto (resfd, buf, r, 0,
+-                 (struct sockaddr *) &_res.nsaddr_list[i],
++                 (struct sockaddr *) &myres.nsaddr_list[i],
+                  sizeof (struct sockaddr));
+ }
+ 
+@@ -1279,15 +1290,15 @@
+       /* Check to see if this server is actually one we sent to */
+       if (from.sin_addr.s_addr == localhost)
+       {
+-        for (i = 0; i < _res.nscount; i++)
+-          if ((_res.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) || (!_res.nsaddr_list[i].sin_addr.s_addr))        /* 0.0.0.0 replies as 127.0.0.1 */
++        for (i = 0; i < myres.nscount; i++)
++          if ((myres.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) || (!myres.nsaddr_list[i].sin_addr.s_addr))      /* 0.0.0.0 replies as 127.0.0.1 */
+             break;
+       }
+       else
+-      for (i = 0; i < _res.nscount; i++)
+-        if (_res.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr)
++      for (i = 0; i < myres.nscount; i++)
++        if (myres.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr)
+           break;
+-      if (i == _res.nscount)
++      if (i == myres.nscount)
+       {
+         snprintf (tempstring, sizeof (tempstring),
+                   "Resolver error: Received reply from unknown source: %s",



Home | Main Index | Thread Index | Old Index