partysip-dev
[Top][All Lists]
Advanced

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

Re: [Partysip-dev] sendto in udp.c


From: Aymeric MOIZARD
Subject: Re: [Partysip-dev] sendto in udp.c
Date: Mon, 15 Mar 2004 13:19:08 +0100 (CET)

Thanks for locating this error, I think many user
have detected this this month.

BUT: It seems that your patch will work for IPv4 only.

I read this link on porting application to IPv6:

http://gsyc.escet.urjc.es/~eva/IPv6-web/ipv6.html

And found that the code seems fine about getting the
size of the element??

The only difference I get was this one about defining the
struct ppl_sockaddr:

Can you try this change instead of yours:
(in ppl/unix/ppl/ppl_dns.h ONLY).

and KEEP the code in udp.c: about the size: "sizeof (addr)"

#ifdef HAVE_GETADDRINFO

#if 0
  struct ppl_sockaddr {
    u_char ss_len;
    u_char ss_family;
    u_char padding[128 - 2];
  };

#else

#if ULONG_MAX > 0xffffffff
# define __ss_aligntype __uint64_t
#else
# define __ss_aligntype __uint32_t
#endif
#define _SS_SIZE        128
#define _SS_PADSIZE     (_SS_SIZE - (2 * sizeof (__ss_aligntype)))

struct ppl_sockaddr
{
    sa_family_t ss_family;      /* Address family */
    __ss_aligntype __ss_align;  /* Force desired alignment.  */
    char __ss_padding[_SS_PADSIZE];
};

#endif

#endif

Let me know if this modification only will correct the
"invalid argument". This way the code will work for both
IPv6 and IPv4.

Or may be struct "sizeof(struct sockaddr)" will work for
both IPv6 or IPv4? Probably no reason to worry on this?

Aymeric

On Wed, 10 Mar 2004, Jun Miyoshi wrote:

> Hello.
> I'm sorry if it is a problem only in my environment.
>
> I was not able to receive response to "REGISTER".
> When the error was looked at, it was set to "invalid argument"
> by "sendto."
> I changed the line-895 of udp.c into the line-896.
> Then, response can be received now.
>
> It is set to "HAVE_GETADDRINFO is defined" in my environment.
> It seems that the size of "struct ppl_sockaddr" is too large.
>
> <partysip-2.1.1/plugin/udp/udp.c>
>    799  #ifdef HAVE_GETADDRINFO
>    800    struct addrinfo *addrinfo;
>    801    struct ppl_sockaddr addr;
>    802  #else
>
>    893  #else
>    894    sock = ctx->out_socket;
>    895    i = sendto (sock, (const void *) buf, strlen (buf), 0,
>    896                /* (struct sockaddr *) &addr, sizeof (addr)); */
>    897                (struct sockaddr *) &addr, sizeof (struct sockaddr));
>    898
>    899  #endif
>
> <partysip-2.1.1/ppl/unix/ppl/ppl_dns.h>
>     89  #ifdef HAVE_GETADDRINFO
>     90    struct ppl_sockaddr {
>     91      u_char ss_len;
>     92      u_char ss_family;
>     93      u_char padding[128 - 2];
>     94    };
>     95  #endif
>
> --- my environment ---
> % uname -a
> SunOS ultra25 5.9 Generic_112233-11 sun4u sparc SUNW,UltraAX-i2
>
> % gcc -v
> Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/specs
> Configured with: ../configure --with-as=/usr/ccs/bin/as 
> --with-ld=/usr/ccs/bin/ld --disable-nls
> Thread model: posix
> gcc version 3.3.2
>
>
>
> _______________________________________________
> Partysip-dev mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/partysip-dev
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]