@miconda commented on this pull request.

Is it better to store it here in the destination structure, instead of matching 
PROTO_NONE with PROTO_UDP in the ds_is_from_list()?

> @@ -699,8 +722,28 @@ ds_dest_t *pack_dest(str iuri, int flags, int priority, 
> str *attrs, int dload)
 
        /* Copy the port out of the URI */
        dp->port = puri.port_no;
-       /* Copy the proto out of the URI */
-       dp->proto = puri.proto;
+       /* Modify proto to default if PROTO_NONE was found according to RFC 3263
+               If no transport param is present in the URI, the default is UDP 
for numerical
+               addresses:
+               If non-numerical address and port it specified, the default is 
UDP as well.
+               If non-numerical address and no port is specified, the proto 
should be discovered
+               using DNS NAPTR/SRV lookups.  In this case we set PROTO_NONE 
and later the
+               forwarding function (e.g. t_relay) will set the correct proto 
based on the DNS records found.
+       */
+       if(puri.proto == PROTO_NONE) {
+               if(is_numeric_host(&puri.host) == 0) {

I think you can just do here `str2ipx(&puri.host) != NULL` , the wrapper 
function is not necessary, the length is checked inside this function as well.


> @@ -35,6 +35,7 @@
 #include <stdint.h>
 #include <time.h>
 #include <math.h>
+#include <arpa/inet.h>

Probably no longer needed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4535#pullrequestreview-3608309560
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4535/review/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to