[Kamailio-Devel] [ openser-Bugs-2678508 ] Problems in DNS-SRV handling (multiple hosts in the answer)

Alex Hermann alex at speakup.nl
Fri Apr 24 12:35:52 CEST 2009


On Friday 24 April 2009, SourceForge.net wrote:
> Bugs item #2678508, was opened at 2009-03-10 12:45
> Below is a patch wich adds some more debugging, and as a bonus, in the
> last chunk it actually fixes the issue for me. I hereby request that
> someone familiar with the code checks if I added the increment at the right
> spot. If it seems right, please apply the last chunk to SVN.

As expected the patch is mangled by SF. Below a correct one.

Alex.


Index: kamailio-speakup-1.4/resolve.c
===================================================================
--- kamailio-speakup-1.4.orig/resolve.c 2009-04-23 16:29:12.000000000 +0200
+++ kamailio-speakup-1.4/resolve.c      2009-04-24 12:29:34.000000000 +0200
@@ -748,6 +748,8 @@
                n->vals[l].ival = get_srv(r)->port;
                n->vals[l].sval = p;
                memcpy( p, get_srv(r)->name, get_srv(r)->name_len );
+               LM_DBG("nodes: %p  node: %p  idx: %d  vals: %p  sval: %s  ival: %d",
+                       dn, n, l, n->vals[l], n->vals[l].sval, n->vals[l].ival);
                LM_DBG("storing %.*s:%d\n", get_srv(r)->name_len,p,n->vals[l].ival);
                p += get_srv(r)->name_len;
                *(p++) = 0;
@@ -1289,6 +1291,9 @@
        n = *node;
        last_srv = NULL;
        he = 0;
+
+       LM_DBG("nodes: %p  node: %p  idx: %d  vals: %p  sval: %s  ival: %d",
+               node, *node, n->idx, n->vals[n->idx], n->vals[n->idx].sval, n->vals[n->idx].ival);

        do {
                switch (n->type) {
@@ -1344,6 +1349,7 @@
                                        shm_free(last_srv);
                                        *node = 0;
                                }
+                               n->idx++;
                                return he;
                                break;
                        default:



More information about the Devel mailing list