Function in sip_transport_udp.c bugs in IPv6 and pjsip_endpt_acquire_transport bugs too

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

 



On Fri, Feb 13, 2009 at 5:41 PM, cedric leveque
<levequecedric at hotmail.com>wrote:

>  Hi,
>
> I'm trying to update my application for IPv6 but I discover a lot of bug in
> PJSIP.
> I use last version of PJSIP and I don't work with PJSUA nor PJSimple-UA.
>
>

Hi Cedric,

first of all sorry for the looong delay for replying this. You're right,
there have been quite few bugs, I've just committed the fix in
http://trac.pjsip.org/repos/ticket/755

More comments below.



> First of all, I have tested in IPv6 the sample program simpleua, and it
> doesn't work : Segmentation Fault.
> I have add the define value in config_site.h, change pj_AFINET to
> pj_AFINET6, and compile correctly PJSIP.
>
>

Yes, this should have been fixed now.


After investigation, I see in get_published_name function in
> sip_transport_udp.c, in else part of "if (tmp_addr.addr.sa_family ==
> pj_AF_INET())" line 504, you haven't used pj_strcpy2 to copy hosbuf in
> bound_name->host
> If you add it, there is no segmentation fault, but the published address
> print to screen is "::" :(
>
>

Fixed too. The problem was pjsip didn't handle when the returned/bound
address is 0.


I haven't debug more this application because I don't try to get published
> name.
> I create UDP socket with a known IP address and port like this :
>
>  if (AF == pj_AF_INET())
>  {
>      //pj_sockaddr_in addr;
>      addIPSuccess = pj_inet_aton(&(dial->localInfo->IP),
> &(dial->addr.sin_addr));
>         dial->addr.sin_port = pj_htons(dial->localInfo->sipPort);
>      dial->addr.sin_family = pj_AF_INET();
>      status = pjsip_udp_transport_start( g_endpt, &(dial->addr), NULL, 1,
> NULL);
>  }
>  else if (AF == pj_AF_INET6())
>  {
>      //pj_sockaddr_in6 addr;
>      addIPSuccess = pj_inet_pton(pj_AF_INET6(), &(dial->localInfo->IP),
> &(dial->addr6.sin6_addr));
>         dial->addr6.sin6_port = pj_htons(dial->localInfo->sipPort);
>      dial->addr6.sin6_family = pj_AF_INET6();
>      status = pjsip_udp_transport_start6(g_endpt, &(dial->addr6), NULL, 1,
> NULL);
>  }
>  else
>  {
>      status = PJ_EAFNOTSUP;
>  }
>
> "dial" is a structure used to keep data for a sip dialog (I don't use PJSIP
> dialog for some reasons too long to explain)
> "localInfo" also is a structure that contains local IP (pj_str_t) and a
> port (int).
>
> It's works well in IPv4 but not in IPv6.
>
>

It should work now.

If I create a structure pjsip_host_port, init manualy it with data from
> localInfo, and calls pjsip_udp_transport_start6 with this params, I can
> create an UDP socket in IPv6.
> It's works well like this.
>
>
> After doing this, I have discovered another bug, this time when I want send
> SIP message.
> To send SIP message, I use my own function that calls
> pjsip_endpt_acquire_transport and pjsip_transport_send. It's works well in
> IPv4 but not in IPv6.
> After long investigation, it seems that acquire_transport doesn't work, and
> if you put some logs in the find_entry the called hash function (from
> pjlib), you don't see the same log print on screen in IPv4 or IPv6.
>

That's also correct. Turns out pjsip_udp_transport_start6() didn't properly
register IPv6 transport type to the hash table. Fixed.


>
> It's seems that source code has been updated in version 1.0.1, may be you
> haven't tested it in IPv6 ?
>
>

Indeed. IPv6 is not something that I test very often, so thanks for the
report!

But if you don't use pjsip_endpt_acquire_transport, create your own socket,
> attach an UDP transport on it, like PJSUA done, you can send SIP message in
> IPv6.
>
> Actually, I use transport created by pjsip_udp_transport_start6 to send SIP
> message, and it's work, I can establish a SIP session between two PJSIP User
> Agent.
>
> I don't know if you have time to investigate more these bug, it would be
> great if you can do it, but I hope my mail can help other people that are
> trying PJSIP in IPv6 not with PJSUA.
>
> If you have more information about all these bugs, I would be happy to know
> them :)
>
>

Once again thanks for taking the time to investigate this, and sorry with
the delay in responding!

I'll probably need to add IPv6 option in pjsua so that this can be tested
easily in the future.

cheers
 Benny



Thanks to have read me.
>
> Regards,
>
> C?dric.
>
> ------------------------------
> Votre correspondant a choisi Hotmail et profite d'un stockage quasiment
> illimit?. Cr?ez un compte Hotmail gratuitement !<http://www.windowslive.fr/hotmail/default.asp>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090317/fa6c5b1e/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux