schneuwlym created an issue (kamailio/kamailio#4173)

### Description

The output of `kamcmd dns.view` shows two times the parameter `rr_regexp`, but 
`rr_replacement` is missing.

### Troubleshooting

#### Reproduction

Lookup a NAPTR record with `kamcmd dns.lookup NAPTR ...` and check the output
```
# kamcmd dns.lookup NAPTR test.example.com 
{
        name: test.example.com
        type: NAPTR
        size_bytes: 328
        reference_counter: 2
        permanent: no
        expires: 300
        last_used: 0
        negative_entry: no
        records: {
                {
                        rr_idx: 0
                        rr_order: 10
                        rr_preference: 10
                        rr_flags: S
                        rr_service: SIPS+D2T
->                      rr_regexp: 
->                      rr_regexp: _sips._tcp.test.example.com
                        rr_permanent: no
                        rr_expires: 300
                }
                {
                        rr_idx: 1
                        rr_order: 20
                        rr_preference: 10
                        rr_flags: S
                        rr_service: SIP+D2U
->                      rr_regexp: 
->                      rr_regexp: _sip._udp.test.example.com
                        rr_permanent: no
                        rr_expires: 300
                }
        }
}

```

### Possible Solutions

**Change is untested!**

```patch
diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 1507e89015..65445fcf8f 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -3921,7 +3921,7 @@ int dns_cache_print_entry(rpc_t *rpc, void *ctx, struct 
dns_hash_entry *e)
                                }
                                s.s = ((struct naptr_rdata *)(rr->rdata))->repl;
                                s.len = ((struct naptr_rdata 
*)(rr->rdata))->repl_len;
-                               if(rpc->struct_add(sh, "S", "rr_regexp", &s) < 
0) {
+                               if(rpc->struct_add(sh, "S", "rr_replacement", 
&s) < 0) {
                                        rpc->fault(ctx, 500,
                                                        "Internal error adding 
naptre rr_replacement");
                                        return -1;

```

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.8.4 (x86_64/linux) f1d83d
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 
262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: f1d83d
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4173
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/4...@github.com>
_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to